diff --git a/install_postfix_advanced.sh b/install_postfix_advanced.sh index 009625e..70b2517 100755 --- a/install_postfix_advanced.sh +++ b/install_postfix_advanced.sh @@ -631,6 +631,19 @@ alias_maps = alias_database = hash:/etc/aliases +## - Optional address mapping lookup tables for envelope and header sender +## - addresses. The table format and lookups are documented in canonical(5). +## - +## - Example: you want to rewrite the SENDER address "user@ugly.domain" +## - to "user@pretty.domain", while still being able to send mail to the +## - RECIPIENT address "user@ugly.domain". +## - +## - Note: \$sender_canonical_maps is processed before \$canonical_maps. +## - +sender_canonical_maps = btree:/etc/postfix/sender_canonical + + + ## - Optional lookup tables with mappings from recipient address ## - to (message delivery transport, next-hop destination). ## - See transport(5) for details. @@ -1270,6 +1283,19 @@ else echo_failed fi +echononl " Create file \"sender_canonical\"" +if [[ ! -f /etc/postfix/sender_canonical ]]; then + cat < /etc/postfix/sender_canonical +@localhost @$(hostname -f) +EOF +fi +postmap btree:/etc/postfix/sender_canonical +if [[ $? -eq 0 ]] ; then + echo_ok +else + echo_failed +fi + echononl " Create file \"transport\"" if [[ ! -f /etc/postfix/transport ]]; then cat < /etc/postfix/transport diff --git a/install_postfix_base.sh b/install_postfix_base.sh index b87a02b..b68ec97 100755 --- a/install_postfix_base.sh +++ b/install_postfix_base.sh @@ -568,6 +568,17 @@ alias_maps = alias_database = hash:/etc/aliases +## - Optional address mapping lookup tables for envelope and header sender +## - addresses. The table format and lookups are documented in canonical(5). +## - +## - Example: you want to rewrite the SENDER address "user@ugly.domain" +## - to "user@pretty.domain", while still being able to send mail to the +## - RECIPIENT address "user@ugly.domain". +## - +## - Note: \$sender_canonical_maps is processed before \$canonical_maps. +## - +sender_canonical_maps = btree:/etc/postfix/sender_canonical + ## - The maximal time a message is queued before it is sent back as ## - undeliverable. Defaults to 5d (5 days) @@ -949,6 +960,20 @@ else echo_failed fi +echononl " Create file \"sender_canonical\"" +if [[ ! -f /etc/postfix/sender_canonical ]]; then + cat < /etc/postfix/sender_canonical +@localhost @$(hostname -f) +EOF +fi +postmap btree:/etc/postfix/sender_canonical +if [[ $? -eq 0 ]] ; then + echo_ok +else + echo_failed +fi + + ## - restart postfix ## - echononl " Restart postfix"