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

当我configurationautoreply,sender_bcc和always_bcc时,postfix将把两个邮件转发给用户。 我已经使用了dovecot和mysql的postfix来进行虚拟用户configuration。 我没有发现问题在哪里。

当我从[email protected]发送邮件到[email protected]和main.cf我总是有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的主动input如下所示。

 # ========================================================================== # 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 - nn - - 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 - nn - - local virtual unix - nn - - 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 - nn - - pipe # flags=Rq user=spamd argv=/usr/bin/spamc -u ${user} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} #dovecot unix - nn - - pipe # flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -d ${recipient} #spamfilter unix - nn - - pipe # flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient} #spamfilter unix - nn - - pipe # flags=Rq user=vmail argv=/usr/bin/spamc -u ${user}@${domain} -e /usr/sbin/sendmail.postfix -oi -f ${sender} ${recipient} dfilt unix - nn - - pipe flags=Rq user=filterAlt argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient} #vacation unix - nn - - 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 

同样的方式,如果我发送邮件autoreply用户然后还发件人获得两封邮件。

很可能你有一个内容filter,并且在内容filter之前和之后都会调用always_bcc。 在包含内容filter之前或之后自定义smtpd

 -o receive_override_options=no_address_mappings 

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

对我来说main.cf中的' enable_original_recipient = No '做了这个诀窍。:-)