aliasing virtual de postfix entre dois domínios hospedados no mesmo servidor de email

1

A situação: tenho dois domínios: domain.pl e domain.com. Eu configurei dois emails [email protected] e [email protected]. Eu também tenho certificado SSL válido apenas em ssl.domain.com.

O problema: quero configurar todas as mensagens a serem encaminhadas de [email protected] = > [email protected] (ou, idealmente, todas as coisas de @ domain.com para domain.pl).

O que eu fiz: usei o aliasing virtual e os dois emails foram entregues corretamente, mas o encaminhamento não está funcionando. Eu também tentei o truque recipient_bcc_maps, mas sem sorte. Estou usando o postfix 2.9.6. Aqui estão meus arquivos de configuração:

main.cf

# /etc/mailname => domain.com
myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/postfix/keys/domain.crt
smtpd_tls_key_file=/etc/postfix/keys/domain.key
smtpd_tls_CAfile=/etc/postfix/keys/startssl.ca
smtpd_use_tls=yes
smtpd_tls_security_level=may
#smtpd_tls_auth_only=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, permit
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, permit
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, reject_unknown_sender_domain, check_policy_service unix:private/policy-spf

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

dovecot_destination_recipient_limit = 1
local_recipient_maps =

myhostname = ssl.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
message_size_limit = 102400000
recipient_delimiter = +
inet_interfaces = all

# trick try, forwards contained:
# [email protected] [email protected]
#recipient_bcc_maps = hash:/etc/postfix/forwards

#DKIM
milter_default_action = accept
milter_protocol = 6
smtpd_milters = inet:localhost:12345
non_smtpd_milters = inet:localhost:12345

#VIRTUAL
virtual_transport = dovecot-spamass
virtual_mailbox_domains = domain.pl, domain.com
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_alias_maps = hash:/etc/postfix/virtual

master.cf

smtp      inet  n       -       -       -       -       smtpd
    -o receive_override_options=no_address_mappings
submission inet n       -       -       -       -       smtpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
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
relay     unix  -       -       -       -       -       smtp
    -o smtp_fallback_relay=
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

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${user}@${domain} ${extension} ${recipient} ${user} ${nexthop}

uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

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 -f ${sender} -d ${recipient}

dovecot-spamass   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/bin/spamc -u ${recipient} -e /usr/lib/dovecot/deliver -f ${sender} -d ${recipient}

policy-spf  unix  -  n  n  -  -  spawn user=nobody argv=/usr/bin/policyd-spf

vmailbox

[email protected] whatever
[email protected] whatever

virtual

@domain.com [email protected]
@domain.pl [email protected]

aliases

mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: tom

E aqui está a saída de sendmail -bv [email protected]

This is the mail system at host ssl.domain.com.

Enclosed is the mail delivery report that you requested.

                   The mail system

<[email protected]> (expanded from <[email protected]>): delivery via
    dovecot-spamass: delivers to command: /usr/bin/spamc


Reporting-MTA: dns; ssl.domain.com
X-Postfix-Queue-ID: D23E242559
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC)

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822; [email protected]
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via dovecot-spamass: delivers to command:
    /usr/bin/spamc


Return-Path: <[email protected]>
Received: by ssl.domain.com (Postfix, from userid 0)
    id D23E242559; Tue, 11 Feb 2014 02:54:16 +0000 (UTC)
X-DKIM: OpenDKIM Filter v2.6.8 ssl.domain.com D23E242559
DKIM-Signature: ......
From: [email protected]
Subject: probe
To: [email protected]
Message-Id: <[email protected]>
Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC)

Estou realmente sem ideias e qualquer ajuda será muito apreciada. Eu tenho esse sentimento feio, que estou sentindo falta de algo super-simples ...

    
por Ajgon 11.02.2014 / 03:57

1 resposta

1

Você pode inserir em / etc / aliases

jerry: [email protected],[email protected]
tom: [email protected],[email protected]

e você recebe todos os e-mails.

    
por 06.03.2014 / 12:45