![Postfix:从特定发件人处获取 50 份或更多份同一封电子邮件](https://linux22.com/image/780120/Postfix%EF%BC%9A%E4%BB%8E%E7%89%B9%E5%AE%9A%E5%8F%91%E4%BB%B6%E4%BA%BA%E5%A4%84%E8%8E%B7%E5%8F%96%2050%20%E4%BB%BD%E6%88%96%E6%9B%B4%E5%A4%9A%E4%BB%BD%E5%90%8C%E4%B8%80%E5%B0%81%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6.png)
我有一个在 Centos 7 上运行的 Postfix (2.10.1) / Dovecot 服务器。我每个周末都会从特定服务器收到大约 50 份相同的电子邮件,我尝试使用 wireshark,但它使用 STARTTLS,因此全部加密,因此我打开了 postfix 的登录功能。一切看起来都很好,然后我在 DATA 和 QUEUED 之间遇到了巨大的延迟。见下文。请注意时间戳,它需要 4 分 14 秒,最后也没有 QUIT,我认为远程服务器正在超时,因此它只是继续发送消息。我注意到延迟似乎与 opendkim 有关,所以有什么想法可以解决这个问题吗?这是 opendkim 的问题吗?为什么在数据传输期间检查 DKIM?为什么检查 DKIM 签名需要那么长时间?到目前为止,我知道的只有大约三个发件人遇到这种情况,但这变得相当麻烦。谢谢!
Sep 5 15:15:10 services postfix/smtpd[17135]: > unknown[54.240.15.240]: 250 2.1.5 Ok
Sep 5 15:15:10 services postfix/smtpd[17135]: < unknown[54.240.15.240]: DATA
Sep 5 15:15:10 services postfix/smtpd[17135]: report data to all milters
Sep 5 15:15:10 services postfix/smtpd[17135]: milter_macro_lookup: "i"
Sep 5 15:15:10 services postfix/smtpd[17135]: milter_macro_lookup: result "4A0FB12A7"
Sep 5 15:15:10 services postfix/smtpd[17135]: milter8_data_event: milter inet:127.0.0.1:8891: data command
Sep 5 15:15:10 services postfix/smtpd[17135]: skipping non-protocol event SMFIC_DATA for milter inet:127.0.0.1:8891
Sep 5 15:15:10 services postfix/smtpd[17135]: send 1 milters
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr conn_macros = j {daemon_name} v
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer}
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer}
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer}
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr data_macros = i
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr eoh_macros = i
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr eod_macros = i
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr unk_macros =
Sep 5 15:15:10 services postfix/smtpd[17135]: milter8_send: milter inet:127.0.0.1:8891
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_name = inet:127.0.0.1:8891
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_version = 2
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_actions = 273
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_events = 2
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_non_events = 768
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_state = 4
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_conn_timeout = 30
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_cmd_timeout = 30
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_msg_timeout = 300
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_action = accept
Sep 5 15:15:10 services postfix/smtpd[17135]: send attr milter_macro_list = 0
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: dummy
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: dummy
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute value: (end)
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: (list terminator)
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: (end)
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: dummy
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: dummy
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute value: (end)
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: (list terminator)
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: (end)
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: status
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: status
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute value: 0
Sep 5 15:15:10 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: (list terminator)
Sep 5 15:15:10 services postfix/smtpd[17135]: input attribute name: (end)
Sep 5 15:15:10 services postfix/smtpd[17135]: > unknown[54.240.15.240]: 354 End data with <CR><LF>.<CR><LF>
Sep 5 15:15:10 services postfix/cleanup[17137]: 4A0FB12A7: message-id=<010001830f0b97bf-95e8fbf3-db43-47f5-b374-375fb854f93d-000000@email.amazonses.com>
Sep 5 15:15:10 services opendkim[844]: 4A0FB12A7: [54.240.15.240] [54.240.15.240] not internal
Sep 5 15:15:10 services opendkim[844]: 4A0FB12A7: not authenticated
Sep 5 15:19:24 services opendkim[844]: 4A0FB12A7: message has signatures from primevideo.com, amazonses.com
Sep 5 15:19:24 services opendkim[844]: 4A0FB12A7: DKIM verification successful
Sep 5 15:19:24 services postfix/qmgr[17047]: 4A0FB12A7: from=<202209051906004530ab8903c4489cb0803dfa57e0p0na-C2PQNMO0KKWW5B@bounces.primevideo.com>, size=98742, nrcpt=1 (queue activ
e)
Sep 5 15:19:24 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: status
Sep 5 15:19:24 services postfix/smtpd[17135]: input attribute name: status
Sep 5 15:19:24 services postfix/smtpd[17135]: input attribute value: 0
Sep 5 15:19:24 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: reason
Sep 5 15:19:24 services postfix/smtpd[17135]: input attribute name: reason
Sep 5 15:19:24 services postfix/smtpd[17135]: input attribute value: (end)
Sep 5 15:19:24 services postfix/smtpd[17135]: public/cleanup socket: wanted attribute: (list terminator)
Sep 5 15:19:24 services postfix/smtpd[17135]: input attribute name: (end)
Sep 5 15:19:24 services postfix/smtpd[17135]: > unknown[54.240.15.240]: 250 2.0.0 Ok: queued as 4A0FB12A7
添加了 master.cf -
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
smtp_tls_loglevel = 4
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
myorigin = origindom.com
inet_protocols = all
mydestination = /etc/postfix/mydestination
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
home_mailbox = Maildir/
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail
smtpd_banner = mail.origindom.com ESMTP $mail_name ($mail_version)
mynetworks_style = class
ignore_mx_lookup_error = yes
smtpd_recipient_restrictions = permit_sasl_authenticated reject_unauth_destinati on
smtpd_sender_restrictions = permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_authenticated_header = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.origindom.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.origindom.com/privkey.pem
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cach e
smtpd_use_tls = yes
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
mailbox_size_limit = 5368709120
debug_peer_list = origindom.com
message_size_limit = 31457280
myhostname = origindom.com
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtpd_relay_restrictions = permit_mynetworks permit_inet_interfaces permit_sasl_ authenticated
milter_protocol = 2
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
receive_override_options = no_address_mappings
sender_bcc_maps = hash:/etc/postfix/sender_bcc_maps
sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps
canonical_maps = hash:/etc/postfix/canonical