Postfix拒绝从本地客户端中继邮件

我试图让一个Python脚本来发送邮件(使用smtplib.SMTP ),但后缀拒绝中继该消息。 我不使用Ubuntu 10.10 Virtualmin服务器作为邮件服务器(我碰巧使用谷歌应用程序),但我希望脚本能够发送邮件。 这里是日志,地址用通用的地址进行了重新表示:

Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: connect from localhost[127.0.0.1] Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<unimatrix-01.example.com> Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: lost connection after RSET from localhost[127.0.0.1] Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: disconnect from localhost[127.0.0.1] 

我已经试过没有成功,根据Ubuntu Docs运行#dpkg-reconfigure postfix来解决这个问题。 我怎样才能解决这个问题?

提前致谢。

更新:有趣的是,使用PHP的应用程序可以发送邮件就好了。 所以,我怀疑它与本地需要身份validation的后缀有关。 这是没有必要的,因为我使用这个VP的唯一用户。 我希望这有助于排除故障。

检查是否允许本地networking中继电子邮件而无需身份validation。

首先,下面的命令应该包含permit_mynetworks

 sudo postconf smtpd_recipient_restrictions 

然后检查127.0.0.1是否在$ mynetworks中 。 做就是了,

 sudo postconf mynetworks 

并检查是否有127.0.0.1

我猜你没有设置mydomain任何地方,因此不告诉postfix它可以提供邮件的地方。

你基本上需要设置mydomain = gmail.com,然后添加gmail.com或$ mydomain到我的目的地。

确保重新加载/重新启动后缀

从squirrelmail网页界面发送电子邮件时遇到问题。 它说:

 relay access denied 

我通过删除我的/etc/hosts的以下条目来修复它:

 ::1 localhost ip6-localhost ip6-loopback