我在 Debian Jessie 上使用 exim4 4.84.2-2+deb8u1。下面我用 example.com 替换了一些域名。
dc_use_split_config='true'
我在文件中有一个分割配置/etc/exim4/update-exim4.conf.conf
。
在我的文件中/etc/exim4/conf.d/main/00_local_macros
有:
DKIM_CANON = relaxed
DKIM_SELECTOR = 20161213
DKIM_DOMAIN = example.com
DKIM_FILE = /etc/exim4/dkim/example.com-private.pem
使用 root 权限运行后,update-exim4.conf
我在文件顶部的/var/lib/exim4/config.autogenerated
注释后有了上述配置。
#########
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# This file was generated dynamically from
# split config files in the /etc/exim4/conf.d/ directory.
# The config files are supplemented with package installation/configuration
# settings managed by debconf. This data is stored in
# /etc/exim4/update-exim4.conf.conf
# Any changes you make here will be lost.
# See /usr/share/doc/exim4-base/README.Debian.gz and update-exim4.conf(8)
# for instructions of customization.
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
# WARNING WARNING WARNING
#########
DKIM_CANON = relaxed
DKIM_SELECTOR = 20161213
DKIM_DOMAIN = example.com
DKIM_FILE = /etc/exim4/dkim/example.com-private.pem
当然,该文件还有更多内容。
我使用 重新启动了 exim service exim4 restart
。我注意到运行此命令时未显示正确的配置参数:
# exim -bP | grep example.com
primary_hostname = example.com
qualify_domain = example.com
qualify_recipient = example.com
当我发送邮件时,没有添加 DKIM 签名。
私钥的权限和所有者是:
# ls -la /etc/exim4/dkim/example.com-private.pem
-rw------- 1 root Debian-exim 887 Dec 13 10:23 /etc/exim4/dkim/example.com-private.pem
发送电子邮件时的日志是:
2016-12-15 12:54:01 exim 4.84_2 daemon started: pid=6159, -q30m, listening for SMTP on [127.0.0.1]:25 [::1]:25
2016-12-15 12:54:01 Start queue run: pid=6160
2016-12-15 12:54:01 1cHHnz-0006uo-SS Message is frozen
2016-12-15 12:54:01 1cH6QF-00069Q-Dt Message is frozen
2016-12-15 12:54:01 1cGvKR-0005Pd-HK Message is frozen
2016-12-15 12:54:01 1cGYkT-0003lm-Ti == [email protected] <[email protected]> R=dnslookup T=remote_smtp defer (-53): retry time not reached for any host
2016-12-15 12:54:01 1cHTcJ-0007j9-Ob Message is frozen
2016-12-15 12:54:01 End queue run: pid=6160
2016-12-15 12:54:07 1cHbAM-0001bW-Sl <= [email protected] H=localhost (server01.example.com) [::1] P=esmtp S=8004
2016-12-15 12:54:09 1cHbAM-0001bW-Sl => [email protected] R=dnslookup T=remote_smtp H=mx.example.com [66.96.140.95] X=TLS1.0:RSA_AES_128_CBC_SHA1:128 DN="C=US,O=Sample\, Inc.,OU=IT Team,CN=Server" C="250 LJwY1u03o4xYfnm01 mail accepted for delivery"
2016-12-15 12:54:09 1cHbAM-0001bW-Sl Completed
我如何让 DKIM 工作并且让 exim 识别我的配置?
答案1
解决方案是包含以下配置选项:
DKIM_PRIVATE_KEY = /etc/exim4/dkim/example.com-private.pem
并使用户成为密钥的所有者Debian-exim
。