====== Postfix: virtuelle Domains und Benutzer in Textdateien ======
Voraussetzung: [[postfix-dovecot-imapd]] mit [[wpde>LMTP]] und [[dovecot-virtual-domains]]
===== Maps erstellen =====
# postmap hash:/etc/postfix/virtual_mailbox_domains.txt
example.com yes
postmap hash:/etc/postfix/virtual_mailbox_domains.txt
-> erzeugt ''/etc/postfix/virtual_mailbox_domains.txt.db''
Domain nachschlagen testen:
postmap -q example.com hash:/etc/postfix/virtual_mailbox_domains.txt
-> ''yes''
# postmap hash:/etc/postfix/virtual_alias_maps.txt
postmaster@example.com user1@example.com
abuse@example.com user1@example.com
user1@example.com user1@example.com
user2@example.com user2@example.com
admin@example.com user1@example.com,user2@example.com
postmap hash:/etc/postfix/virtual_alias_maps.txt
Empfänger nachschlagen testen:
postmap -q postmaster@example.com hash:/etc/postfix/virtual_alias_maps.txt
-> ''user1@example.com''
postmap -q user1@example.com hash:/etc/postfix/virtual_alias_maps.txt
-> ''user1@example.com''
===== Postfix konfigurieren =====
mydestination = localhost
virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains.txt
virtual_mailbox_maps = hash:/etc/postfix/virtual_alias_maps.txt
virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps.txt
virtual_transport = lmtp:unix:private/dovecot-lmtp
postfix reload
===== testen =====
Client:
swaks --from user1@example.com --to user2@example.com -s example.com -a -au user1@example.com -ap xxxxxx
-> ''Ok: queued as 46AE13EB41''
Server:
journalctl -g 46AE13EB41
-> ''postfix/lmtp[…]: 46AE13EB41: to=, relay=example.com[private/dovecot-lmtp], …, status=sent''
====== Dokumentation ======
* http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox