我有一个运行良好的 OpenSMTPD 配置,并在其中添加了 dkimproxy。
一切运行良好,邮件测试器等都报告说我有正确的 DKIM 签名,我的电子邮件分数是 10/10 等。
问题是 ...
如果我尝试从 [email protected] 向 [email protected] 发送电子邮件,则邮件服务器进入循环并且邮件永远不会发送。我看到这个maillog
:
Nov 15 08:34:13 mail dkimproxy.out[38686]: DKIM signing - signed; message-id=<[email protected]>, signer=<[email protected]>, from=<[email protected]>
Nov 15 08:34:13 mail smtpd[33463]: 4dea90938ef29e98 smtp message msgid=0b62ff80 size=104666 nrcpt=1 proto=ESMTP
Nov 15 08:34:13 mail smtpd[33463]: 4dea90938ef29e98 smtp envelope evpid=0b62ff80eb408785 from=<> to=<[email protected]>
Nov 15 08:34:13 mail smtpd[33463]: 4dea9092f4274d88 mta delivery evpid=6fe8c750a74f16ac from=<> to=<[email protected]> rcpt=<-> source="200.100.240.135" relay="200.100.240.135 (mail.mydomain.com)" delay=1s result="Ok" stat="250 2.0.0 0b62ff80 Message accepted for delivery"
...并且它可能会一遍又一遍地循环 50 次 - 最终它放弃了这个错误:
Nov 15 08:34:18 mail smtpd[33463]: warn: loop detected
Nov 15 08:34:18 mail smtpd[33463]: 4dea9097226c93aa smtp failed-command command="DATA" result="500 5.4.6 Routing loop detected: Loop detected"
Nov 15 08:34:18 mail smtpd[33463]: 4dea90969c6cf495 mta delivery evpid=49514d020281ac48 from=<> to=<[email protected]> rcpt=<-> source="200.100.240.135" relay="200.100.240.135 (mail.mydomain.com)" delay=1s result="PermFail" stat="500 5.4.6 Routing loop detected: Loop detected"
我不知道问题是什么。仅当我向自己或在此邮件服务器上托管的具有此域的其他用户发送电子邮件时,才会发生这种情况。
# cat dkimproxy_in.conf
# specify what address/port DKIMproxy should listen on
listen 200.100.240.135:10025
# specify what address/port DKIMproxy forwards mail to
relay 200.100.240.135:10026
# cat dkimproxy_out.conf
# specify what address/port DKIMproxy should listen on
listen 200.100.240.135:10027
# specify what address/port DKIMproxy forwards mail to
relay 200.100.240.135:10028
# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
domain mydomain.com
# specify what signatures to add
signature dkim(c=relaxed)
signature domainkeys(c=nofws)
# specify location of the private key
keyfile /root/dkim.private.key
# specify the selector (i.e. the name of the key record put in DNS)
selector selector1
# control how many processes DKIMproxy uses
# - more information on these options (and others) can be found by
# running `perldoc Net::Server::PreFork'.
#min_servers 5
#min_spare_servers 2
......这就是一切......谢谢。
编辑 - 这是 opensmtpd.conf:
table aliases file:/usr/local/etc/mail/aliases
filter check_dyndns phase connect match rdns regex \
{ '.*\.dyn\..*', '.*\.dsl\..*' } \
disconnect "550 no residential connections"
filter check_rdns phase connect match !rdns \
disconnect "550 no rDNS"
filter check_fcrdns phase connect match !fcrdns \
disconnect "550 no FCrDNS"
listen on 200.100.240.135 filter { check_dyndns, check_rdns, check_fcrdns }
listen on 200.100.240.135 port 10028 tag DKIM
listen on 200.100.240.135 port submission
action "local_mail" mbox alias <aliases>
action "relay_dkim" relay host smtp://200.100.240.135:10027
action "outbound" relay helo mail.mydomain.com
match from any mail-from "[email protected]" action "local_mail"
match tag DKIM for any action "outbound"
match for any action "relay_dkim"
match from any for domain "mydomain.com" action "local_mail"
match for local action "local_mail"
match from any auth for any action "outbound"
match for any action "outbound"