postfix 在转发邮件时发送双重邮件

postfix 在转发邮件时发送双重邮件

当我配置自动回复、sender_bcc 和 always_bcc 时,postfix 会将两封邮件转发给用户。我已经使用 postfix 与 dovecot 和 mysql 进行虚拟用户配置。我不知道问题出在哪里。

当我从发送邮件时[电子邮件保护][电子邮件保护]在 main.cf 中我有 always_bcc=pranav@sufalam。以下是日志。

May 30 07:25:27 sufalammail postfix/smtpd[7827]: connect from unknown[192.168.0.201]
May 30 07:26:58 sufalammail postfix/smtpd[7827]: 69139222DE: client=unknown[192.168.0.201]
May 30 07:27:13 sufalammail postfix/cleanup[7839]: 69139222DE: message-id=<[email protected]>
May 30 07:27:13 sufalammail postfix/qmgr[7824]: 69139222DE: from=<[email protected]>, size=363, nrcpt=2 (queue active)
May 30 07:27:14 sufalammail postfix/pickup[7823]: 050C4222E0: uid=491 from=<[email protected]>
May 30 07:27:14 sufalammail postfix/cleanup[7839]: 050C4222E0: message-id=<[email protected]>
May 30 07:27:14 sufalammail postfix/qmgr[7824]: 050C4222E0: from=<[email protected]>, size=475, nrcpt=3 (queue active)
May 30 07:27:14 sufalammail postfix/pipe[7842]: 69139222DE: to=<[email protected]>, relay=dfilt, delay=93, delays=92/0.04/0/0.59, dsn=2.0.0, status=sent (delivered via dfilt service)
May 30 07:27:14 sufalammail postfix/pipe[7842]: 69139222DE: to=<[email protected]>, relay=dfilt, delay=93, delays=92/0.04/0/0.59, dsn=2.0.0, status=sent (delivered via dfilt service)
May 30 07:27:14 sufalammail postfix/qmgr[7824]: 69139222DE: removed
May 30 07:27:14 sufalammail postfix/virtual[7852]: 050C4222E0: to=<[email protected]>, relay=virtual, delay=0.16, delays=0.03/0.02/0/0.1, dsn=2.0.0, status=sent (delivered to mailbox)
May 30 07:27:14 sufalammail postfix/virtual[7852]: 050C4222E0: to=<[email protected]>, relay=virtual, delay=0.16, delays=0.03/0.02/0/0.11, dsn=2.0.0, status=sent (delivered to mailbox)
May 30 07:27:14 sufalammail postfix/virtual[7852]: 050C4222E0: to=<[email protected]>, relay=virtual, delay=0.16, delays=0.03/0.02/0/0.11, dsn=2.0.0, status=sent (delivered to mailbox)
May 30 07:27:14 sufalammail postfix/qmgr[7824]: 050C4222E0: removed
May 30 07:27:15 sufalammail postfix/smtpd[7827]: disconnect from unknown[192.168.0.201]

master.cf 的活动条目显示如下。

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -        -       -       -       smtpd
#        -o content_filter=spamfilter:dummy
         -o content_filter=vacation:dummy
         -o content_filter=dfilt:dummy
#       -o cleanup_service_name= cleanupAF
vacation  unix  -       n        n       -       -       pipe
    flags=Rq user=vacation argv=/var/spool/vacation/vacation3.pl -f ${sender} -- ${recipient}
# flags=Rq user=vacation argv=/usr/bin/perl argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
#submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       n       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
relay     unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
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
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
#spamassassin unix -      n       n       -       -       pipe
#    flags=Rq user=spamd argv=/usr/bin/spamc -u ${user} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
#dovecot    unix  -       n       n       -       -       pipe
#       flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -d ${recipient}
#spamfilter unix         -       n       n       -       -       pipe
#   flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}
#spamfilter unix -       n       n       -       -       pipe
#    flags=Rq user=vmail argv=/usr/bin/spamc -u ${user}@${domain} -e /usr/sbin/sendmail.postfix -oi -f ${sender} ${recipient}
dfilt     unix    -       n       n       -       -       pipe
    flags=Rq user=filterAlt argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}
#vacation  unix  -       n        n       -       -       pipe
#    flags=Rq user=vacation argv=/var/spool/vacation/vacation3.pl -f ${sender} -- ${recipient}
cleanupAF unix n - n - 0 cleanup
#-o [email protected]
#-o recipient_bcc_maps=mysql:/etc/postfix/mysql-virtual_always_bcc.cf

同样,如果我向自动回复用户发送邮件,那么发件人也会收到两封邮件。

答案1

最有可能的是,你有一个内容过滤器,并且在内容过滤器之前和之后都会调用 always_bcc。在内容过滤器之前或之后自定义 smtpd 以包含

-o receive_override_options=no_address_mappings

(请注意,master.cf 中的选项不能包含空格)。

答案2

对我来说 main.cf 中的 ' enable_original_recipient = No' 就起了作用。:-)

相关内容