como configuro o Postfix para aceitar todos os emails e enviá-los para um endereço específico?

2

Desejo configurar um endereço de e-mail abrangente para o meu domínio. ie (qualquer coisa enviada para [email protected] ou [email protected] irá para uma caixa de correio específica). Eu tenho o Postfix trabalhando com o correio local, mas ele rejeita os e-mails de fora do host.

Eu segui essa configuração para enviar todas as mensagens recebidas para uma conta específica: link . E quando eu envio um e-mail na mesma máquina, ele funciona como esperado:

paul@server1:~/Maildir/new$ ls -l ~/Maildir/new/
total 0
paul@server1:~/Maildir/new$ echo "test email" | mail -s "test subject" [email protected]
paul@server1:~/Maildir/new$ ls -l ~/Maildir/new/
total 4
-rw------- 1 paul paul 2112 Jun 15 19:39 1339774754.V90ceIf21c25M531738.server1
paul@server1:~/Maildir/new$ 

mas quando tento enviar de outro domínio (vou usar o gmail como exemplo) recebo um aviso de não entrega.

aquiestáomail.logparaogmaileachamadalocal:

Jun1519:38:40server1postfix/pickup[489]:88ADDF21C35:uid=1000from=<paul>Jun1519:38:40server1postfix/cleanup[1909]:88ADDF21C35:message-id=<[email protected]>Jun1519:38:40server1postfix/qmgr[490]:88ADDF21C35:from=<[email protected]>,size=349,nrcpt=1(queueactive)Jun1519:38:40server1postfix/local[1911]:88ADDF21C35:to=<[email protected]>,relay=local,delay=0.08,delays=0.05/0.01/0/0.02,dsn=5.1.1,status=bounced(unknownuser:"u123456")
Jun 15 19:38:40 server1 postfix/cleanup[1909]: 93FDAF21C39: message-id=<[email protected]>
Jun 15 19:38:40 server1 postfix/bounce[1912]: 88ADDF21C35: sender non-delivery notification: 93FDAF21C39
Jun 15 19:38:40 server1 postfix/qmgr[490]: 93FDAF21C39: from=<>, size=2096, nrcpt=1 (queue active)
Jun 15 19:38:40 server1 postfix/qmgr[490]: 88ADDF21C35: removed
Jun 15 19:38:40 server1 postfix/local[1911]: 93FDAF21C39: to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:38:40 server1 postfix/qmgr[490]: 93FDAF21C39: removed
Jun 15 19:39:14 server1 postfix/pickup[489]: 7B866F21C35: uid=1000 from=<paul>
Jun 15 19:39:14 server1 postfix/cleanup[1909]: 7B866F21C35: message-id=<[email protected]>
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7B866F21C35: from=<[email protected]>, size=349, nrcpt=1 (queue active)
Jun 15 19:39:14 server1 postfix/local[1911]: 7B866F21C35: to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "u123456")
Jun 15 19:39:14 server1 postfix/cleanup[1909]: 7EFA0F21C39: message-id=<[email protected]>
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7EFA0F21C39: from=<>, size=2096, nrcpt=1 (queue active)
Jun 15 19:39:14 server1 postfix/bounce[1912]: 7B866F21C35: sender non-delivery notification: 7EFA0F21C39
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7B866F21C35: removed
Jun 15 19:39:14 server1 postfix/local[1911]: 7EFA0F21C39: to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7EFA0F21C39: removed
Jun 15 19:40:02 server1 postfix/pickup[489]: 6EC93F21C39: uid=107 from=<smmsp>
Jun 15 19:40:02 server1 postfix/cleanup[1909]: 6EC93F21C39: message-id=<[email protected]>
Jun 15 19:40:02 server1 postfix/qmgr[490]: 6EC93F21C39: from=<[email protected]>, size=665, nrcpt=1 (queue active)
Jun 15 19:40:02 server1 postfix/local[1911]: 6EC93F21C39: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.11, delays=0.1/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:40:02 server1 postfix/qmgr[490]: 6EC93F21C39: removed
Jun 15 19:40:53 server1 postfix/smtpd[1975]: connect from mail-wg0-f42.google.com[74.125.82.42]
Jun 15 19:40:53 server1 postfix/smtpd[1975]: NOQUEUE: reject: RCPT from mail-wg0-f42.google.com[74.125.82.42]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-wg0-f42.google.com>
Jun 15 19:40:54 server1 postfix/smtpd[1975]: disconnect from mail-wg0-f42.google.com[74.125.82.42]

e, ao contrário do envio local, não há novos e-mails no diretório.

paul@server1:~/Maildir/new$ ls -l
total 4
-rw------- 1 paul paul 2112 Jun 15 19:39 1339774754.V90ceIf21c25M531738.server1
paul@server1:~/Maildir/new$ 

Existe algo sobre correio não local que está fazendo isso? Como obtenho o postfix para aceitar todos os e-mails para todos os usuários e colocá-los em uma caixa de entrada de usuário específica?

EDIT: adicionando main.cf

paul@server1:~/Maildir/new$ cat /etc/postfix/main.cf 
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = server1.helpmeco.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = helpmeco.de, server1.helpmeco.de, localhost.helpmeco.de, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
    
por browep 15.06.2012 / 17:46

1 resposta

3

descobri. Eu estava faltando algumas entradas no meu arquivo main.cf:

smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, reject

virtual_alias_maps = hash:/etc/postfix/virtual

local_recipient_maps =

fazendo o main.cf completo:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_reject_unlisted_recipient = no
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, reject

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = server1.helpmeco.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = helpmeco.de, server1.helpmeco.de, localhost.helpmeco.de, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/

virtual_alias_maps = hash:/etc/postfix/virtual

local_recipient_maps =
    
por 15.06.2012 / 19:52