Postfix -> Dovecot Catchall no funciona (ya)

Postfix -> Dovecot Catchall no funciona (ya)

Tengo un problema con la instalación de mi postfix + dovecot. Desde julio mi comodín ya no funciona. Me di cuenta del problema hace apenas unos días, porque un amigo mío envió explícitamente un correo a una dirección inexistente y no llegó. Así que revisé algunos registros y descubrí que el comodín ya no parece funcionar.

Al mirar el directorio de almacenamiento de correo, vi que Dovecot creaba nuevos buzones para cada 'usuario' antes de @, en lugar de entregarlos en mi buzón. El más antiguo de estos buzones es de julio, así que creo que algo salió mal allí. No he cambiado mi configuración de postfix/dovecot desde hace un año.

Editar: la última frase no era cierta. Eliminé ClamAV de mi servidor a principios de este año. ¿Quizás lo arruiné?

Sin embargo, siempre instalo las actualizaciones cuando llegan. El servidor ejecuta Debian Squeeze.

Aquí está mi configuración de 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}

Mi mail.log muestra lo siguiente (el[correo electrónico protegido]debe ser entregado a[correo electrónico protegido]):

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]

Mi base de datos MySQL para los reenvíos se ve así:

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

El archivo de registro de Dovecot muestra que postfix no resuelve el destino correcto:

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

Registro de consultas MySQL desde 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'

La última línea indica que postfix intenta resolver la dirección que no existe. Ejecutando manualmente la consulta:

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

Entonces todo parece estar en su lugar y debería funcionar. Pero no es así. ¿Alguien tiene una idea de qué puede causar este comportamiento?

Gracias por leer esto ;)

Saludos Sebastián

Respuesta1

En tu main.cftienes receive_override_options = no_address_mappings. Esto desactiva el comodín. Elimine esta línea para habilitarla nuevamente.

Probablemente tenías receive_override_optionsuna configuración diferente de la instancia de postfix después del filtro de contenido clamav que habilitaba el general antes.

información relacionada