Postfix - Dovecot Catchall não funciona (não mais)

1

Eu tenho um problema com a minha instalação do postfix + dovecot. Desde julho meu catch-all não funciona mais. Eu percebi o problema há poucos dias, porque um amigo meu mandou explicitamente um e-mail para um endereço inexistente e ele não chegou. Então eu vasculhei alguns logs e descobri que o pega-tudo parece não funcionar mais.

Olhando para o diretório de armazenamento de e-mail, vi que a Dovecot criou novas caixas de correio para cada 'usuário' antes do @, em vez de entregá-lo na minha caixa de correio. A mais antiga dessas caixas de correio é de julho, então acho que algo deu errado lá. Eu não mudei minha configuração postfix / dovecot desde um ano.

Edit: The last sentence wasn't true. I removed ClamAV from my server earlier this year. Maybe I screwed it up?

No entanto, sempre instalo atualizações quando elas chegam. O servidor está executando o Debian Squeeze.

Aqui está a configuração do meu postfix:

~ > 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  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       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  -       n       n       -       -       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  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
#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}
dovecot   unix  -       n       n       -       -       pipe
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
spamassassin unix -     n       n       -       -       pipe
        user=spamd argv=/usr/bin/spamc -f -e
        /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Meu mail.log mostra o seguinte (o [email protected] deve ser entregue para [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]

Meu banco de dados MySQL para os encaminhamentos é assim:

    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] |
+--------------+-----------------------+

O arquivo de log do Dovecot mostra que o postfix não resolve o destino correto:

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

Registrando as consultas do MySQL do postfix:

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'

A última linha indica que o postfix tenta resolver o endereço inexistente. Executando manualmente a consulta:

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

Então, tudo parece estar no lugar e deve funcionar. Mas isso não acontece. Alguém tem uma ideia do que pode causar esse comportamento?

Obrigado por ler isto;)

Atenciosamente, Sebastian

    
por theFen 05.09.2013 / 16:48

1 resposta

0

No seu main.cf você tem receive_override_options = no_address_mappings . Isso desativa o pega-tudo. Remova esta linha para ativá-la novamente.

Você provavelmente teve receive_override_options diferente em sua configuração da instância postfix após o filtro de conteúdo clamav que ativou a função catch-all antes.

    
por 06.09.2013 / 06:25