Postfix - 有时会出现收件人密件抄送地图重复的电子邮件

Postfix - 有时会出现收件人密件抄送地图重复的电子邮件

我有 Postfix/Dovecot/Spamassassin 服务器以及以下电子邮件帐户:

virtual_mailbox_maps:
info@domain domain/info/
service@domain domain/info/

recipient_bcc_maps
info@domain bcc@domain2
service@domain bcc@domain2

因此,我希望将 info@ 和 service@ 的电子邮件发送到单个邮箱,并将每封电子邮件转发到外部地址。这确实有效,但 Postifx 经常将重复的电子邮件发送到 中定义的 BCC recipient_bcc_maps。电子邮件以单份形式发送到本地帐户。

以下是来自 Postfix 日志的此类重复传送的示例:

Aug 12 12:24:18 mail-server postfix/smtpd[29828]: C251A1009B: client=sender.host[IP]
Aug 12 12:24:18 mail-server postfix/cleanup[29834]: C251A1009B: message-id=<ID1>
Aug 12 12:24:18 mail-server postfix/qmgr[29197]: C251A1009B: from=<[email protected]>, size=1974, nrcpt=2 (queue active)
Aug 12 12:24:19 mail-server postfix/smtpd[29828]: disconnect from sender.host[IP] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Aug 12 12:24:19 mail-server postfix/pickup[29196]: 9859E10173: uid=1004 from=<[email protected]>
Aug 12 12:24:19 mail-server postfix/cleanup[29834]: 9859E10173: message-id=<ID1>
Aug 12 12:24:19 mail-server postfix/qmgr[29197]: 9859E10173: from=<[email protected]>, size=2390, nrcpt=2 (queue active)
Aug 12 12:24:19 mail-server postfix/pipe[29836]: C251A1009B: to=<service@domain>, relay=spamassassin, delay=0.83, delays=0.12/0.01/0/0.7, dsn=2.0.0, status=sent (delivered via spamassassin service)
Aug 12 12:24:19 mail-server postfix/virtual[29842]: 9859E10173: to=<service@domain>, relay=virtual, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Aug 12 12:24:20 mail-server postfix/pickup[29196]: 01B7C10174: uid=1004 from=<[email protected]>
Aug 12 12:24:20 mail-server postfix/cleanup[29834]: 01B7C10174: message-id=<ID1>
Aug 12 12:24:20 mail-server postfix/pipe[29835]: C251A1009B: to=<[email protected]>, relay=spamassassin, delay=1.2, delays=0.12/0/0/1.1, dsn=2.0.0, status=sent (delivered via spamassassin service)
Aug 12 12:24:20 mail-server postfix/qmgr[29197]: C251A1009B: removed
Aug 12 12:24:20 mail-server postfix/qmgr[29197]: 01B7C10174: from=<[email protected]>, size=2398, nrcpt=1 (queue active)
Aug 12 12:24:25 mail-server postfix/smtp[29847]: 01B7C10174: to=<[email protected]>, relay=bcc.host[IP]:25, delay=5.4, delays=0/0.01/5.1/0.27, dsn=2.0.0, status=sent (250 OK id=1oMRq5-00FIxG-4V)
Aug 12 12:24:25 mail-server postfix/qmgr[29197]: 01B7C10174: removed
Aug 12 12:24:25 mail-server postfix/smtp[29843]: 9859E10173: to=<[email protected]>, relay=bcc.host[IP]:25, delay=5.9, delays=0/0.01/5.6/0.29, dsn=2.0.0, status=sent (250 OK id=1oMRq5-00Ax60-6y)
Aug 12 12:24:25 mail-server postfix/qmgr[29197]: 9859E10173: removed

我无法发现其中的规律,这些重复的电子邮件有什么共同点...有什么建议吗 - 应该寻找什么?我对 Postifx 的使用经验不多,也许我没有发现一些明显的东西...

更新

配置转储

root@texas:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
content_filter = smtp-amavis:[127.0.0.1]:10024
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = texas.nettigo.net, localhost, localhost.localdomain, localhost
myhostname = texas.nettigo.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_bcc_maps = hash:/etc/postfix/rcpt_bcc
recipient_delimiter = +
relay_domains = $mydestination $secondary_mx_for
relayhost =
secondary_mx_for = nhw.pl
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_proxy_options = speed_adjust
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000

root@texas:~# postconf -M
smtp       inet  n       -       y       -       -       smtpd -o content_filter=spamassassin
spamassassin unix -      n       n       -       -       pipe user=spamd argv=/usr/bin/spamc -s 640000 -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
submission inet  n       -       y       -       -       smtpd
pickup     unix  n       -       y       60      1       pickup -o content_filter= -o receive_override_options=no_header_body_checks
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}
smtp-amavis unix -       -       y       -       2       smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes -o max_use=20
127.0.0.1:10025 inet n   -       y       -       -       smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

答案1

它被复制了两次,因为它遍历了两个邮件传输协议实例都继承了您的全局(main.cf)bcc 映射配置,这是您将 spamassassin 集成到服务器中的结果。

编辑您的 master.cf 并添加之后指定的选项127.0.0.1:10025,已经为该特定实例清除或禁用了一些选项。

127.0.0.1:10025 ...
-o ...
-o recipient_bcc_maps=
-o ...

这样,您将第二次禁用该行为,同时在接收端保持该行为。

相关内容