Postfix – > Dovecot Catchall不工作(再)

我的postfix + dovecot安装有问题。 自从七月份以来,我的所有人都不再工作了。 我几天前才意识到这个问题,因为我的一个朋友明确地向不存在的地址发送了一封邮件,而且没有到达。 于是我挖掘了几个日志,发现这个全部看起来不再起作用。

看着邮件存储目录,我看到Dovecot在@之前为每个“用户”创build了新的邮箱,而不是将其发送到我的邮箱。 这些邮箱中最老的是从七月份开始,所以我觉得那里出了问题。 一年以来,我还没有改变我的后缀/ dovecotconfiguration。

编辑:最后一句话是不正确的。 今年早些时候,我从服务器上删除了ClamAV。 也许我搞砸了?

但是,我总是在到达时安装更新。 该服务器正在运行Debian Squeeze。

这是我的后缀configuration:

~ > sudo postconf -n broken_sasl_auth_clients = yes config_directory = /etc/postfix mailbox_size_limit = 1099511627776 message_size_limit = 1073741824 mydestination = mail.mydomain.de myhostname = mail.mydomain.de mynetworks = 127.0.0.0/8 proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps receive_override_options = no_address_mappings smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unknown_sender_domain, reject_rbl_client bl.spamcop.net, reject_rbl_client ix.dnsbl.manitu.net, permit smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_tls_cert_file = /etc/postfix/smtpd.cert smtpd_tls_key_file = /etc/postfix/smtpd.key smtpd_use_tls = yes virtual_alias_domains = virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf virtual_gid_maps = static:5000 virtual_mailbox_base = /home/vmail virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_transport = dovecot virtual_uid_maps = static:5000 ~ > sudo cat /etc/postfix/mysql-virtual_forwardings.cf user = mail_admin password = 123456 dbname = mail query = SELECT destination FROM forwardings WHERE source='%s' hosts = 127.0.0.1 ~ > cat /etc/postfix/master.cf # # Postfix master process configuration file. For details on the format # of the file, see the master(5) manual page (command: "man 5 master"). # # Do not forget to execute "postfix reload" after editing this file. # # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - - - - smtpd #submission inet 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 -o content_filter=spamassassin #smtps inet n - - - - smtpd # -o smtpd_tls_wrappermode=yes # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #628 inet n - - - - qmqpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - - 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp # When relaying mail as backup MX, disable fallback_relay to avoid MX loops relay unix - - - - - smtp -o smtp_fallback_relay= # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 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. # Also specify in main.cf: maildrop_destination_recipient_limit=1 # #maildrop unix - nn - - pipe # flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} # # ==================================================================== # # Recent Cyrus versions can use the existing "lmtp" master.cf entry. # # Specify in cyrus.conf: # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 # # Specify in main.cf one or more of the following: # mailbox_transport = lmtp:inet:localhost # virtual_transport = lmtp:inet:localhost # # ==================================================================== # # Cyrus 2.1.5 (Amos Gouaux) # Also specify in main.cf: cyrus_destination_recipient_limit=1 # #cyrus unix - nn - - pipe # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} # # ==================================================================== # Old example of delivery via Cyrus. # #old-cyrus unix - nn - - pipe # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} # # ==================================================================== # # See the Postfix UUCP_README file for configuration details. # uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) # # Other external delivery methods. # #ifmail unix - nn - - pipe # flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) #bsmtp unix - nn - - pipe # flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient #scalemail-backend unix - nn - 2 pipe # flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} #mailman unix - nn - - pipe # flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py # ${nexthop} ${user} dovecot unix - nn - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient} spamassassin unix - nn - - pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient} 

我的mail.log显示以下内容([email protected]应该交付给[email protected]):

 Sep 5 16:27:18 lvps5-35-246-109 postfix/smtpd[7969]: connect from mail.other.com[194.XX.XX.77] Sep 5 16:27:18 lvps5-35-246-109 postfix/smtpd[7969]: E24511027C1CE: client=mail.other.com[194.XX.XX.77] Sep 5 16:27:18 lvps5-35-246-109 postfix/cleanup[7973]: E24511027C1CE: message-id=<[email protected]> Sep 5 16:27:18 lvps5-35-246-109 postfix/qmgr[5915]: E24511027C1CE: from=<[email protected]>, size=4723, nrcpt=1 (queue active) Sep 5 16:27:20 lvps5-35-246-109 postfix/pickup[5916]: A0D821027C1D3: uid=5001 from=<[email protected]> Sep 5 16:27:20 lvps5-35-246-109 postfix/cleanup[7973]: A0D821027C1D3: message-id=<[email protected]> Sep 5 16:27:20 lvps5-35-246-109 postfix/pipe[7975]: E24511027C1CE: to=<[email protected]>, relay=spamassassin, delay=1.8, delays=0.07/0.01/0/1.7, dsn=2.0.0, status=sent (delivered via spamassassin service) Sep 5 16:27:20 lvps5-35-246-109 postfix/qmgr[5915]: E24511027C1CE: removed Sep 5 16:27:20 lvps5-35-246-109 postfix/qmgr[5915]: A0D821027C1D3: from=<[email protected]>, size=5081, nrcpt=1 (queue active) Sep 5 16:27:20 lvps5-35-246-109 postfix/pipe[7982]: A0D821027C1D3: to=<[email protected]>, relay=dovecot, delay=0.07, delays=0.05/0.01/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service) Sep 5 16:27:20 lvps5-35-246-109 postfix/qmgr[5915]: A0D821027C1D3: removed Sep 5 16:27:23 lvps5-35-246-109 postfix/smtpd[7969]: disconnect from other.com[194.XX.XX.77] 

我的MySQL数据库的转发看起来像这样:

  mysql> describe forwardings; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | source | varchar(80) | NO | PRI | NULL | | | destination | text | NO | | NULL | | +-------------+-------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) mysql> select * from forwardings; +--------------+-----------------------+ | source | destination | +--------------+-----------------------+ | @mydomain.de | [email protected] | +--------------+-----------------------+ 

Dovecot日志文件显示postfix不能parsing正确的目的地:

 2013-09-05 16:27:20 deliver([email protected]): Info: msgid=<[email protected]>: saved mail to INBOX 

logging来自postfix的MySQL查询:

 130905 16:09:34 68 Query SELECT domain AS virtual FROM domains WHERE domain='other.com' 68 Query SELECT domain AS virtual FROM domains WHERE domain='mydomain.de' 69 Query SELECT destination FROM forwardings WHERE source='[email protected]' 70 Query SELECT email FROM users WHERE email='[email protected]' 69 Query SELECT destination FROM forwardings WHERE source='@mydomain.de' 

最后一行表示postfix尝试parsing不存在的地址。 手动执行查询:

 mysql> SELECT destination FROM forwardings WHERE source='@mydomain.de'; +-----------------------+ | destination | +-----------------------+ | [email protected] | +-----------------------+ 1 row in set (0.00 sec) 

所以一切似乎都到位,应该工作。 但事实并非如此。 有没有人有一个想法可能会导致这种行为?

感谢您阅读本文;)

问候,塞巴斯蒂安

在你的main.cf你有receive_override_options = no_address_mappings 。 这使禁用所有。 删除此行以再次启用它。

你可能在postfix实例的configuration中有不同的receive_override_options在之前启用了catch-all的clamav内容filter之后。