我的服务器设置与本文完全相同:安装并配置 DKIMproxy,但我遇到了以下问题。
当我通过端口 587 向我的服务器发送电子邮件时,我在 mail.log 中收到以下内容:
Sep 1 16:49:38 mailer postfix/smtpd[9974]: connect from unknown[xxx.xxx.xxx.xxx]
Sep 1 16:49:39 mailer postfix/smtpd[9974]: 0B6C5301BC: client=unknown[xxx.xxx.xxx.xxx]
Sep 1 16:49:39 mailer postfix/cleanup[9970]: 0B6C5301BC: message-id=<[email protected]>
Sep 1 16:49:39 mailer postfix/qmgr[9949]: 0B6C5301BC: from=<[email protected]>, size=552, nrcpt=1 (queue active)
Sep 1 16:49:39 mailer postfix/smtp[9953]: connect to 127.0.0.1[127.0.0.1]:10027: Connection refused
Sep 1 16:49:39 mailer postfix/smtp[9953]: 0B6C5301BC: to=<[email protected]>, relay=none, delay=0.14, delays=0.14/0/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10027: Connection refused)
我已将 /etc/dkimproxy/dkimproxy_out.conf 设置如下:
# specify what address/port DKIMproxy should listen on
listen 127.0.0.1:10027
# specify what address/port DKIMproxy forwards mail to
relay 127.0.0.1:10028
# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
# Note that this is set in /etc/init.d/dkimproxy in this Debian package
# unactivate it there if you want to use the config file
domain mailer.xxx.com
# specify what signatures to add
signature dkim(c=relaxed)
signature domainkeys(c=nofws)
# specify location of the private key
keyfile /etc/dkimproxy/keys/email.key
# specify the selector (i.e. the name of the key record put in DNS)
selector mail
然后我的 /etc/postfix/master.cf 附加了以下内容(根据教程):
submission inet n - n - - smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_sasl_auth_enable=yes
-o content_filter=dksign:[127.0.0.1]:10027
-o receive_override_options=no_address_mappings
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
dksign unix - - n - 10 smtp
-o smtp_send_xforward_command=yes
-o smtp_discard_ehlo_keywords=8bitmime,starttls
我似乎无法弄清楚为什么我在 DKIMproxy 应该监听的端口上不断收到“连接被拒绝”的消息。有人能帮我解决这个问题吗?我不需要在防火墙中打开任何东西,对吧?因为它应该只是在本地主机上进行内部连接?
我感觉我已经接近完成它了!
答案1
在您的帖子中添加了 2 条评论,但您确定添加了以下部分吗主配置文件?
# service for accepting messages FROM the DKIM signing proxy
127.0.0.1:10028 inet n - n - 10 smtpd
-o content_filter=
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
Postfix 需要监听 10028,以便 DKIM 完成其部分后可以传递连接。
答案2
知道了。
我有一个防火墙规则限制本地主机流量并阻止访问这些端口(或者我认为是这样):
REJECT all -- anywhere 127.0.0.0/8 reject-with icmp-port-unreachable
删除后,我就可以运行 dkimproxy 并使用指定的端口。谢谢您的帮助!