我在更改用于 Postfix 电子邮件的服务器时遇到了一些问题。
我已经在 Linux 服务器(CentOS 5)上安装了 postfix 并进行了如下设置。
我将设置添加到/etc/postfix/main.cf
relayhost=imap.googlemail.com
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
然后我创建了 /etc/postfix/sasl_passwd 文件,其中包含以下内容
imap.googlemail.com fake_usernm:fake_passwd
将其映射为
postmap /etc/postfix/sasl_passwd
然后一切工作正常,但现在当我尝试将中继主机更改为 smtp 服务器 mail.example.co.za:26 时,电子邮件似乎没有发送。我检查了邮件日志,其中包含以下内容
Sep 7 09:30:23 dev postfix/pickup[32641]: E8BF874E3D4: uid=0 from=<root>
Sep 7 09:30:23 dev postfix/cleanup[32691]: E8BF874E3D4: message-id=<[email protected]>
Sep 7 09:30:23 dev postfix/qmgr[32642]: E8BF874E3D4: from=<[email protected]>, size=333, nrcpt=1 (queue active)
Sep 7 09:30:26 dev postfix/smtp[32693]: certificate verification failed for mail.example.co.za: num=20:unable to get local issuer certificate
Sep 7 09:30:26 dev postfix/smtp[32693]: certificate verification failed for mail.example.co.za: num=27:certificate not trusted
Sep 7 09:30:28 dev postfix/smtp[32693]: E8BF874E3D4: to=<[email protected]>, relay=mail.example.co.za[198.57.162.234]:26, delay=4.4, delays=0.07/0.02/3.8/0.51, dsn=5.0.0, status=bounced (host mail.example.co.za[198.57.162.234] said: 550-Verification failed for <[email protected]> 550-The mail server could not deliver mail to [email protected]. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
Sep 7 09:30:28 dev postfix/cleanup[32691]: 9D7D374E3D6: message-id=<[email protected]>
Sep 7 09:30:28 dev postfix/qmgr[32642]: 9D7D374E3D6: from=<>, size=2642, nrcpt=1 (queue active)
Sep 7 09:30:28 dev postfix/bounce[32695]: E8BF874E3D4: sender non-delivery notification: 9D7D374E3D6
Sep 7 09:30:28 dev postfix/qmgr[32642]: E8BF874E3D4: removed
Sep 7 09:30:28 dev postfix/cleanup[32691]: A72DF74E3D1: message-id=<[email protected]>
Sep 7 09:30:28 dev postfix/qmgr[32642]: A72DF74E3D1: from=<>, size=2777, nrcpt=1 (queue active)
Sep 7 09:30:28 dev postfix/local[32696]: 9D7D374E3D6: to=<[email protected]>, relay=local, delay=0.06, delays=0.03/0.01/0/0.02, dsn=2.0.0, status=sent (forwarded as A72DF74E3D1)
Sep 7 09:30:28 dev postfix/qmgr[32642]: 9D7D374E3D6: removed
Sep 7 09:30:31 dev postfix/smtp[32693]: certificate verification failed for mail.example.co.za: num=20:unable to get local issuer certificate
Sep 7 09:30:31 dev postfix/smtp[32693]: certificate verification failed for mail.example.co.za: num=27:certificate not trusted
我不知道有什么不同以及如何解决这个问题
答案1
我遇到的错误似乎实际上是由服务器 /etc/hosts 文件中的错误引起的。
我能够重新配置主机文件并进行测试
# hostname
输出是正确的
dev.server.com
然而
# hostname -f
会输出错误,但重新配置后会输出
dev.server.com
哪个是正确的并解决了我在中继主机上遇到的问题