Postfix installation: add 'sender_canonical_maps' to postfix conf file 'main.cf'.

This commit is contained in:
Christoph 2018-05-30 01:31:02 +02:00
parent 0d8f4a7c84
commit 8b8dbd75fc
2 changed files with 51 additions and 0 deletions

View File

@ -631,6 +631,19 @@ alias_maps =
alias_database = alias_database =
hash:/etc/aliases 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 ## - Optional lookup tables with mappings from recipient address
## - to (message delivery transport, next-hop destination). ## - to (message delivery transport, next-hop destination).
## - See transport(5) for details. ## - See transport(5) for details.
@ -1270,6 +1283,19 @@ else
echo_failed echo_failed
fi fi
echononl " Create file \"sender_canonical\""
if [[ ! -f /etc/postfix/sender_canonical ]]; then
cat <<EOF > /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\"" echononl " Create file \"transport\""
if [[ ! -f /etc/postfix/transport ]]; then if [[ ! -f /etc/postfix/transport ]]; then
cat <<EOF > /etc/postfix/transport cat <<EOF > /etc/postfix/transport

View File

@ -568,6 +568,17 @@ alias_maps =
alias_database = alias_database =
hash:/etc/aliases 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 ## - The maximal time a message is queued before it is sent back as
## - undeliverable. Defaults to 5d (5 days) ## - undeliverable. Defaults to 5d (5 days)
@ -949,6 +960,20 @@ else
echo_failed echo_failed
fi fi
echononl " Create file \"sender_canonical\""
if [[ ! -f /etc/postfix/sender_canonical ]]; then
cat <<EOF > /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 ## - restart postfix
## - ## -
echononl " Restart postfix" echononl " Restart postfix"