Added a second virtual_alias_map so that emails to existing users won't be caught from an catchall alias
This commit is contained in:
Felix 2014-09-27 15:13:40 +02:00
parent a4c70f7a92
commit bbc2c25d29
1 changed files with 8 additions and 1 deletions

View File

@ -77,7 +77,8 @@ tools/editconf.py /etc/postfix/main.cf \
tools/editconf.py /etc/postfix/main.cf \
virtual_mailbox_domains=sqlite:/etc/postfix/virtual-mailbox-domains.cf \
virtual_mailbox_maps=sqlite:/etc/postfix/virtual-mailbox-maps.cf \
virtual_alias_maps=sqlite:/etc/postfix/virtual-alias-maps.cf \
virtual_alias_maps=sqlite:/etc/postfix/virtual-alias-maps.cf, \
sqlite:/etc/postfix/virtual-self-alias-maps.cf \
local_recipient_maps=\$virtual_mailbox_maps
# SQL statement to check if we handle mail for a domain, either for users or aliases.
@ -98,6 +99,12 @@ dbpath=$db_path
query = SELECT destination FROM aliases WHERE source='%s'
EOF
# SQL statement to implicitly define an alias for each user so that existing users won't be caught by catchall aliases.
cat > /etc/postfix/virtual-self-alias-maps.cf << EOF;
dbpath=$db_path
query = SELECT email FROM users WHERE email='%s'
EOF
# Restart Services
##################