本地网络上的 opendkim 不工作

本地网络上的 opendkim 不工作

mcduckcorp.duckburg.cali我在学校有一项作业,在同一台机器上为 Debian 9 操作系统上的地址设置 bind9、postfix、spf、dkim 和 dovecot 。

我已经成功设置了 bind9、postfix 和 dovecot,以便可以发送和接收邮件,但 dkim 设置会产生问题。每当我尝试发送邮件时,都会收到以下错误sudo service opendkim status

opendkim[1097]: 1EBD854249B: 外部主机 www.mcduckcorp.duckburg.cali 尝试以 mcduckcorp.duckburg.cali 身份发送

另外,当我使用命令检查收到的邮件时,mail邮件标题中出现以下错误:

身份验证结果:mail.mcduckcorp.duckburg.cali;dkim=permerror(不良消息/签名格式)

该文件的内容/etc/opendkim.conf是:

Syslog          yes
UMask           007
Domain                  mcduckcorp.duckburg.cali 
KeyFile         /etc/opendkimkeys/private.key
Selector        mail
SubDomains      yes
Socket          inet:12345@localhost
PidFile               /var/run/opendkim/opendkim.pid
OversignHeaders     From
TrustAnchorFile       /usr/share/dns/root.key
UserID                opendkim

该文件/etc/default/opendkim包含:

RUNDIR=/var/run/opendkim
SOCKET=inet:12345@localhost
USER=opendkim
GROUP=opendkim
PIDFILE=$RUNDIR/$NAME.pid
EXTRAAFTER=

该文件/etc/postfix/main.cf包含:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination permit_sasl_authenticated check_policy_service unix:private/policy-spf
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_sasl_authenticated check_policy_service unix:private/policy-spf
myhostname = mail.mcduckcorp.duckburg.cali
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = mcduckcorp.duckburg.cali
mydestination = $myhostname, mcduckcorp.duckburg.cali, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = 192.168.55.6
inet_protocols = all
relay_domains = mcduckcorp.duckburg.cali

# DKIM
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:12345
non_smtpd_milters = inet:localhost:12345

# SPF
policy-spf_time_limit = 3600s

该文件/etc/postfix/master.cf包含:

pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

policy-spf  unix  -       n       n       -       -       spawn
     user=nobody argv=/usr/bin/policyd-spf

该文件/etc/bind/named.conf.local包含:

zone "cali" {
  type master;
  file "/etc/bind/zones/cali.db";
};

zone "duckburg.cali" {
  type master;
  file "/etc/bind/zones/duckburg.cali.db";
};

zone "mcduckcorp.duckburg.cali" {
  type master;
  file "/etc/bind/zones/mcduckcorp.duckburg.cali.db";
  //auto-dnssec maintain;
  inline-signing yes;
};

zone "55.168.192.in-addr.arpa" {
  type master;
  file "/etc/bind/zones/55.168.192.in-addr.arpa.db";
};

/etc/bind/named.conf.options文件包含:

options {
    directory "/var/cache/bind";
    forwarders {
      192.168.55.5;
    };
    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

该文件/etc/bind/zones/mcduckcorp.duckburg.cali.db包含:

@ IN SOA ns1.mcduckcorp.duckburg.cali. mail.mcduckcorp.duckburg.cali. (
        2018101100  ;serial
        86400       ;refresh
        7200        ;retry
        3600000     ;expiration
        172800)     ;minimum

@ IN NS ns1.mcduckcorp.duckburg.cali.
ns1.mcduckcorp.duckburg.cali. IN A 192.168.55.5

www IN  A   192.168.55.5
mail    IN  A   192.168.55.6

squirrel    IN  CNAME   www

mcduckcorp.duckburg.cali.   IN  MX  10 mail.mcduckcorp.duckburg.cali.

mail._domainkey     IN  TXT ( "v=DKIM1; h=sha256; k=rsa; t=y; "
      "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr5UWdHzwwL/gki26JF+y9t/8VUfY9wb2hAwX825D2q4hnIEMFzZSKDyvug7+D19nDp7f1VQ4x2JFvVVVwMwanaB3WHmlsLa9AItFv5yL2i6b1RrXdgFiezJt22K/TNvkjGohxnGsC/7lHIvlkN4Em4Zok/eoquWg294b05I+4vR3TWf2PbxxPgYKR0D9ahtkA632asGAMG0gRh"
      "m8Xw2hPSk6LT0QHWdPM0iw20WZJdZflhjsByIj1BWL+L/TetnCOORwfz6A9T/+L0zQUodpJNKyYbnZ6Wxac4n6pnaiO99znUlKuQDuhyDfSbqLqi9it5Rise6FryhL1YBf5USGtwIDAQAB" )  ; ----- DKIM key mail for mcduckcorp.duckburg.cali

mcduckcorp.duckburg.cali. IN TXT "v=spf1 mx ~all"
mcduckcorp.duckburg.cali. IN SPF "v=spf1 mx ~all"

我已经搜索过错误

dkim=permerror(不良消息/签名格式)

在线但目前还没有能够找到任何看似相关的内容。

相关内容