Ситуация: У меня два домена: domain.pl и domain.com. Я настроил два адреса электронной почты tom@domain.pl и jerry@domain.com. У меня также есть сертификат SSL, действительный только на ssl.domain.com.
Эта проблема: Я хочу настроить пересылку всей почты с jerry@domain.com => tom@domain.pl (или, в идеале, всех вещей с @ domain.com на domain.pl).
Что я сделал: Я использовал виртуальный псевдоним, и оба письма доставляются правильно, но пересылка не работает. Я также попробовал трюк с recipient_bcc_maps, но безуспешно. Я использую postfix 2.9.6. Вот мои файлы конфигурации:
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:
# jerry@domain.com tom@domain.pl
#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
jerry@domain.com whatever
tom@domain.pl whatever
виртуальный
@domain.com tom@domain.pl
@domain.pl tom@domain.pl
псевдонимы
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
А вот результат sendmail -bv jerry@domain.com
This is the mail system at host ssl.domain.com.
Enclosed is the mail delivery report that you requested.
The mail system
<tom@domain.pl> (expanded from <jerry@domain.com>): 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; root@domain.pl
Arrival-Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC)
Final-Recipient: rfc822; tom@domain.pl
Original-Recipient: rfc822; jerry@domain.com
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via dovecot-spamass: delivers to command:
/usr/bin/spamc
Return-Path: <root@domain.pl>
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: root@domain.pl
Subject: probe
To: jerry@domain.com
Message-Id: <20140211025416.D23E242559@ssl.domain.com>
Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC)
На данный момент у меня действительно нет идей, и я буду очень благодарен за любую помощь. У меня ужасное чувство, что мне не хватает чего-то сверхпростого ...
Вы можете вставить в / etc / aliases
jerry: jerry@domain.com,tom@domain.pl
tom: jerry@domain.com,tom@domain.pl
и вы получите всю электронную почту.