电子邮件已发送,但找不到

电子邮件已发送,但找不到

我已经为此工作了两天,迫切需要一些帮助。

Postfix & Dovecot 
CentOS Linux release 7.9.2009
Plesk 18.0.50

大多数情况下,电子邮件都能正确地流入服务器 - 然而,我遇到了一个奇怪的情况,一些通过我们的外部垃圾邮件过滤器并流经转发或别名帐户的电子邮件实际上并没有进入用户的邮箱。

这是我今天早上追踪的其中一封电子邮件的示例:

来自 Mail Assure 垃圾邮件过滤器日志

1pZZdb-0002Mt-IH
myolddomain.com
2023-03-07 07:54
[email protected]
luke
allowlisted
INTERAC e-Transfer: LUKE PITTMAN cancelled the money transfer sent to you.
delivered

上面数据列应该比较明显,但基本上它确认我的服务器收到了来自 Mail Assure(外部垃圾邮件过滤服务)的电子邮件(已发送)。

来自 /var/log/maillog 的匹配电子邮件

Mar  7 07:54:29 server postfix/smtpd[27797]: connect from delivery.mtaroutes.com[185.201.16.200]
Mar  7 07:54:30 server postfix/smtpd[27797]: CB260BC4006B: client=delivery.mtaroutes.com[185.201.16.200]
Mar  7 07:54:31 server postfix/cleanup[28935]: CB260BC4006B: message-id=<248542808.92042284.1678204442900@6ea0c801e2d0>
Mar  7 07:54:31 server postfix/qmgr[14249]: CB260BC4006B: from=<[email protected]>, size=62814, nrcpt=1 (queue active)
Mar  7 07:54:31 server postfix/pipe[28941]: CB260BC4006B: to=<[email protected]>, relay=plesk_virtual, delay=0.67, delays=0.63/0/0/0.04, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Mar  7 07:54:31 server postfix/qmgr[14249]: CB260BC4006B: removed
Mar  7 07:54:31 server postfix/smtpd[27797]: disconnect from delivery.mtaroutes.com[185.201.16.200] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=2 quit=1 commands=8

但就是这样...电子邮件确实不是最终进入邮箱(任何地方、收件箱、垃圾邮件文件夹等)

-bash-4.2# cd /var/qmail/mailnames/mynewdomain.com/luke
-bash-4.2# grep -R CB260BC4006B ./*
-bash-4.2# 

我还跑回根目录并运行了相同的命令,但没有结果,所以它在服务器上实际上无处可找。

为了证明上述命令在查找电子邮件时确实有效,我对一封实际经过的电子邮件运行了该命令:

-bash-4.2# grep -R 134D4BC4006F ./*
./Maildir/cur/1678205924.M212491P6629.server.mydomain.com,S=7790,W=7925:2,: id 134D4BC4006F; Tue,  7 Mar 2023 08:18:44 -0800 (PST)

更令人困惑的是,当我从循环中删除外部垃圾邮件过滤器时,上述电子邮件在日志文件中的结果完全相同,但电子邮件实际上显示在邮箱中。这告诉我垃圾邮件过滤器正在添加一些标头(或其他内容),从而触发 plesk_virtual 邮件系统丢弃电子邮件。或者其他什么。

但我已经达到了服务器管理知识的极限,需要一些指导。

编辑。

-bash-4.2# postconf -n
alias_maps = hash:/etc/aliases, nis:mail.aliases, hash:/var/spool/postfix/plesk/aliases
authorized_flush_users =
authorized_mailq_users =
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 51200000
meta_directory = /etc/postfix
mydestination = localhost.$mydomain, localhost, localhost.localdomain
mynetworks =
newaliases_path = /usr/bin/newaliases.postfix
plesk_virtual_destination_recipient_limit = 1
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-3.5.14/README_FILES
recipient_canonical_classes = envelope_recipient,header_recipient
recipient_canonical_maps = tcp:127.0.0.1:12346
recipient_delimiter =
sample_directory = /usr/share/doc/postfix-3.5.14/samples
sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_send_xforward_command = yes
smtp_tls_security_level = may
smtp_use_tls = no
smtpd_authorized_xforward_hosts = 127.0.0.0/8 [::1]/128
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_milters = inet:127.0.0.1:12768
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/postfix/postfix.pem
smtpd_tls_ciphers = medium
smtpd_tls_dh1024_param_file = /usr/local/psa/etc/dhparams2048.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = TLSv1.2
smtpd_tls_protocols = TLSv1.2
smtpd_tls_security_level = may
smtpd_use_tls = yes
smtputf8_enable = no
tls_medium_cipherlist = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
tls_preempt_cipherlist = yes
tls_server_sni_maps = hash:/var/spool/postfix/plesk/certs
tls_ssl_options = no_compression
transport_maps = , hash:/var/spool/postfix/plesk/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_gid_maps = static:30
virtual_mailbox_base = /var/qmail/mailnames
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_mailbox_limit = 0
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox
virtual_transport = plesk_virtual
virtual_uid_maps = static:30
-bash-4.2# postconf -M
smtp       inet  n       -       n       -       -       smtpd
cleanup    unix  n       -       n       -       0       cleanup
tlsmgr     unix  -       -       n       1000?   1       tlsmgr
rewrite    unix  -       -       n       -       -       trivial-rewrite
bounce     unix  -       -       n       -       0       bounce
defer      unix  -       -       n       -       0       bounce
trace      unix  -       -       n       -       0       bounce
verify     unix  -       -       n       -       1       verify
flush      unix  n       -       n       1000?   0       flush
proxymap   unix  -       -       n       -       -       proxymap
proxywrite unix  -       -       n       -       1       proxymap
smtp       unix  -       -       n       -       -       smtp
relay      unix  -       -       n       -       -       smtp -o syslog_name=postfix/$service_name
showq      unix  n       -       n       -       -       showq
error      unix  -       -       n       -       -       error
retry      unix  -       -       n       -       -       error
discard    unix  -       -       n       -       -       discard
local      unix  -       n       n       -       -       local
virtual    unix  -       n       n       -       -       virtual
lmtp       unix  -       -       n       -       -       lmtp
anvil      unix  -       -       n       -       1       anvil
scache     unix  -       -       n       -       1       scache
postlog    unix-dgram n  -       n       -       1       postlogd
plesk_virtual unix -     n       n       -       -       pipe flags=DORhu user=popuser:popuser argv=/usr/lib64/plesk-9.0/postfix-local -f ${sender} -d ${recipient} -p /var/qmail/mailnames -q ${queue_id}
127.0.0.1:12346 inet n   n       n       -       -       spawn user=popuser:popuser argv=/usr/lib64/plesk-9.0/postfix-srs
mailman    unix  -       n       n       -       -       pipe flags=R user=mailman:mailman argv=/usr/lib64/plesk-9.0/postfix-mailman ${nexthop} ${user} ${recipient}
pickup     fifo  n       -       n       60      1       pickup
qmgr       fifo  n       -       n       1       1       qmgr
smtps      inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes
submission inet  n       -       n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_tls_security_level=may -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
plesk_saslauthd unix y   y       n       -       1       plesk_saslauthd status=5 listen=6 dbpath=/var/spool/postfix/plesk/passwd.db
plesk-158.69.12.128- unix - -    n       -       -       smtp -o smtp_bind_address=158.69.12.128 -o smtp_bind_address6= -o smtp_address_preference=ipv4
plesk-54.39.48.83- unix - -      n       -       -       smtp -o smtp_bind_address=54.39.48.83 -o smtp_bind_address6= -o smtp_address_preference=ipv4
-bash-4.2# 

答案1

您正在追捕幽灵。只有当 Plesk 确实将邮件发送到邮箱时,才会记录邮件日志中的“...status=sent(通过 plesk_virtual 服务发送)...”行。它绝对必须在那个邮箱中。如果您在那里找不到它,则另一个软件(例如客户端过滤规则或下载并删除后)会在发送后将其删除。您的日志也不包含任何 SpamAssassin 行,因此 SA 不会处理邮件。

相关内容