将我们的服务器移到Postfix后,我决定使用OpenDKIM实现DKIM。 我已经成功地安装并运行了这个function,但是当它被启用的时候,服务器上的所有邮件转发都会中断。
例如,如果我在[email protected]下创build一个邮箱,并将其设置为转发到另一个地址(外部和内部受到同等影响),则原始发件人会收到类似以下内容的邮件:
This is the mail system at host server.example.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system <[email protected]>: Command rejected Final-Recipient: rfc822; [email protected] Action: failed Status: 5.7.1 Diagnostic-Code: X-Postfix; Command rejected
有没有人有任何build议或经验? 我对qMail非常熟悉,但是对于Postfix并没有太多的经验,因为这是一个生产服务器,所以我不希望没有任何build议就把事情弄坏。
当以下行被注释掉/etc/postfix.main.cf时,问题得到解决
### custom ### # OpenDKIM #milter_default_action = accept #milter_protocol = 6 #smtpd_milters = , inet:127.0.0.1:8891, inet:127.0.0.1:12768 #non_smtpd_milters = , inet:127.0.0.1:8891, inet:127.0.0.1:12768
这里是相应的maillog错误(当上面的/etc/postfix.main.cf代码被取消注释时出现这些错误:
Sep 8 10:09:09 server postfix/cleanup[24811]: BD99260811C5: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 5.7.1 Command rejected; from=<[email protected]> to=<[email protected]> Sep 8 10:09:09 server postfix/cleanup[24811]: BD99260811C5: to=<[email protected]>, relay=none, delay=0.22, delays=0.22/0/0/0, dsn=5.7.1, status=bounced (Command rejected)
这里的服务分别在端口8891和12768上监听。
[root@server ~]# netstat -anp|grep :8891 tcp 0 0 127.0.0.1:8891 0.0.0.0:* EN 25137/opendkim [root@server ~]# netstat -anp|grep :12768 tcp 0 0 127.0.0.1:12768 0.0.0.0:* EN 33037/psa-pc-remote
完整的configuration文件opendkim.conf可以在这里find。 下面的代码是它的修剪版本。
$ egrep -v '^#' opendkim.conf | egrep -v '$^' PidFile /var/run/opendkim/opendkim.pid Mode sv SendReports yes SoftwareHeader yes Canonicalization relaxed/relaxed Selector default MinimumKeyBits 1024 KeyFile /etc/opendkim/keys/default.private Syslog yes SyslogSuccess yes LogWhy yes UMask 002 OversignHeaders From KeyTable refile:/etc/opendkim/KeyTable SigningTable refile:/etc/opendkim/SigningTable ExternalIgnoreList /etc/opendkim/TrustedHosts InternalHosts /etc/opendkim/TrustedHosts SignatureAlgorithm rsa-sha256 AutoRestart Yes UserID opendkim:opendkim Socket inet:8891@localhost
从我所看到的情况看,你的邮件似乎被拒绝是因为你的一个milter未能处理postfix的命令。 这对postfix来说不是问题,但是你的一个milter不能正常工作。
在你的conf中,定义了两个milters:
请注意,这两个milters是累积的,我们实际上不知道哪一个导致失败。 但是,对我来说,这似乎是后面的一个,因为你似乎并不是第一个遇到的问题。 看到这个问题 ,例如。
除非你因为某种原因需要安装psa-pc-remote,你可以考虑禁用这个milter,只保留opendkim。 否则,解决scheme不在我的专业领域,我只能build议您在问题中添加一个plesk标签,并尝试联系plesk的支持。