I would like to forward all email coming to everything in @foo.com
to [email protected]
and also to the UNIX user baz
.
I tried adding both baz
and [email protected]
to the virtual
file (see config below), but it only seems to forward mails to [email protected]
and not add it to /var/mail/baz
. No errors regarding delivering to baz
show up in the log either (nor does it even mention baz
in the /var/log/mail.log
; [email protected]
does show up in the log though with a status=sent
, after which qmgr
says "removed"; no further information about the test email shows up).
Is there something that I am missing? man 5 virtual
says @domain address, address, ...
is accepted as a pattern, so I think this should just work, right?
/etc/postfix/main.cf
:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
# 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_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mailme
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mailme.foo.com, mailme, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
# Use only ipv4; for some reason ipv6 (used when set to "all") causes "network unreachable" messages in /var/log/mail.log
inet_protocols = ipv4
# Forwarding
virtual_alias_domains = foo.com
virtual_alias_maps = hash:/etc/postfix/virtual
/etc/postfix/virtual
:
@foo.com baz, [email protected]