I've currently three domains. I want to setup (mostly) the same aliases for every domain and retrieve the mails on Thunderbird. It already works to send/receive mails for [email protected]
, [email protected]
and [email protected]
but now I need the some aliases.
If I send a mail from [email protected] to one of these alias-addresses (see below), the mail comes back with the error: Recipient address rejected: User unknown in local recipient table
.
I also don't understand why /etc/aliases is still active. I don't want to use this, because it can't handle same aliases on different domains.
And I already tried to change alias_maps
to virtual_alias_maps
, but it has no effect.
Following aliases/mails should forward its mails to contact@domain1.com
Following aliases/mails should forward its mails to contact@domain2.net
Following aliases/mails should forward its mails to contact@domain3.de
/etc/postfix/main.cf
myhostame = domain1.com
myorigin = domain1.com
mydestination = domain1.com domain2.net domain3.de localhost localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
alias_maps = hash:/etc/aliases proxy:pgsql:/etc/postfix/pgsql-aliases.cf
local_recipient_maps = proxy:pgsql:/etc/postfix/pgsql-boxes.cf $alias_maps
mailbox_transport = lmtp:unix:private/dovecot-lmtp
smtpd_tls_cert_file=/etc/letsencrypt/live/domain1.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/domain1.com/privkey.pem
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_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3
PostgreSQL Table
mail=> table aliases;
alias | email
--------------------------+----------------------
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
[email protected] | [email protected]
/etc/postfix/pgsql-aliases.cf
user=mailreader
dbname=mail
table=aliases
select_field=alias
where_field=email
hosts=unix:/var/run/postgresql
select_field
should be the column that has the destination email, and thewhere_field
should be the column postfix is searching.<[email protected]>: host domain1.com[private/dovecot-lmtp] said: 550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in reply to RCPT TO command)