我被告知,这可能是一个比我的问题更好的位置。
我一直试图设置我的Mac OS X(10.5.8)从本地主机发送电子邮件,以便我可以testing我的脚本。
我通常会收到成功的消息,说电子邮件已经发送,但他们永远不会到达目的地。
他们似乎只是卡在Postfix的mailq:
bash-3.2# mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 60F062E9A958* 343 Wed Oct 13 19:36:24 [email protected] [email protected] 189722E9A92F 3201 Wed Oct 13 19:35:57 MAILER-DAEMON (connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 1A4882E9A930 2750 Wed Oct 13 19:35:57 MAILER-DAEMON (connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 1F62E2E9A931 3197 Wed Oct 13 19:35:57 MAILER-DAEMON (connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 20B5B2E9A932 3199 Wed Oct 13 19:35:57 MAILER-DAEMON (connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 241E12E9A933 3309 Wed Oct 13 19:35:57 MAILER-DAEMON (connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 242562E9A934 2782 Wed Oct 13 19:35:57 MAILER-DAEMON (delivery temporarily suspended: connect to imac.lan[192.168.1.65]: Connection refused) [email protected] 2917A2E9A935 2629 Wed Oct 13 19:35:57 MAILER-DAEMON (Host or domain name not found. Name service error for name=imac.local type=MX: Host not found, try again) [email protected] 295D42E9A936 3309 Wed Oct 13 19:35:57 MAILER-DAEMON (delivery temporarily suspended: connect to imac.lan[192.168.1.65]: Connection refused) [email protected]
我能做些什么来得到这个工作?
如果有帮助的话,我的imac.dev指向我的/ etc / hosts中的127.0.0.1
谢谢,P.
首先,按照您的要求,如何configurationpostfix以在本地主机上侦听:
configurationpostfix通过修改/etc/postfix/main.cf文件来只监听本地主机。 添加或编辑它以具有以下inet_interfaces定义:
inet_interfaces = localhost
确保postfix在启动时启动。 修改/System/Library/LaunchDaemons/org.postfix.master.plist文件,在</dict>之前添加以下行:
<key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>
确保postfix正在运行并反映您的configuration更改:
$ launchctl stop org.postfix.master; launchctl start org.postfix.master
validationpostfix只在本地主机上侦听TCP / 25:
$ netstat -an | grep 'LISTEN' | grep 25
tcp4 0 0 127.0.0.1.25 *.* LISTEN
但是,如果您希望将我在队列中看到的退回邮件传递给imac.lan,则还需要在192.168.1.65(或您当前的IP地址)上进行后缀侦听。 一种方法是将inet_interfaces行修改为:
inet_interfaces = all