dre*_*wag 9 postgresql smtp postfix tls dovecot
我最近按照 linode.com ( https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql )上的说明设置了一个邮件服务器,但我使用的是 postgreSQL 而不是 mySQL。
除了我无法从我的邮件客户端 (Mac Mail) 向外部地址发送电子邮件之外,关于服务器的一切都正常工作。当我尝试向外部地址发送消息时,我从 postfix 收到以下错误:
NOQUEUE: reject: RCPT from comcast.net[174.51.xxx.xx]: 554 5.7.1 <user@somewhere.external.com>: Relay access denied; from=<user@mydomain.com> to=<user@somewhere.external.com> proto=ESMTP helo=<[10.0.0.15]>
Run Code Online (Sandbox Code Playgroud)
(注意我编辑了 from ip 地址)
我已将其配置为使用 dovecot 作为身份验证机制。在 dovecot 日志中,我得到:
Oct 23 16:44:31 auth: Debug: client in: AUTH 2 PLAIN service=smtp nologin lip=50.116.xx.xx rip=174.51.xxx.xx secured resp=<hidden>
Oct 23 16:44:31 auth: Debug: sql(user@mydomain.com,174.51.xxx.xx): query: SELECT email as user, password FROM virtual_users WHERE email='user@mydomain.com';
Oct 23 16:44:31 auth: Debug: client out: OK 2 user=user@mydomain.com
Run Code Online (Sandbox Code Playgroud)
所以看起来 dovecot 正在批准用户名和密码,但 postfix 仍然像被拒绝一样对待它。有没有人知道发生了什么或我可以进一步调试的方法?
谢谢!
dre*_*wag 11
我能够通过将 postfix main.cf 配置更改为以下内容来解决我的问题:
smtpd_relay_restrictions =
permit_mynetworks
permit_sasl_authenticated
defer_unauth_destination
Run Code Online (Sandbox Code Playgroud)
而不是使用 smtpd_recipient_resrictions
事实证明,在 postfix 2.10.0 之后,smtpd_relay_restrictions
应该使用smtpd_recipient_restrictions
. (smtpd_recipient_restrictions
现在应该只用于垃圾邮件限制)。
更多信息:http : //de.postfix.org/ftpmirror/official/postfix-2.10.0.RELEASE_NOTES