Fixed wrong mail headers when using OVERRIDE_HOSTNAME by setting the the hostname explicitly

This commit is contained in:
Florian Lehne 2017-02-10 12:11:49 +01:00
parent 0a6733c65a
commit a2772c83ad
1 changed files with 26 additions and 0 deletions

View File

@ -104,6 +104,9 @@ function register_functions() {
_register_setup_function "_setup_mailname" _register_setup_function "_setup_mailname"
_register_setup_function "_setup_amavis" _register_setup_function "_setup_amavis"
_register_setup_function "_setup_dmarc"
_register_setup_function "_setup_postfix_hostname"
_register_setup_function "_setup_dovecot_hostname"
_register_setup_function "_setup_postfix_override_configuration" _register_setup_function "_setup_postfix_override_configuration"
_register_setup_function "_setup_postfix_sasl_password" _register_setup_function "_setup_postfix_sasl_password"
@ -395,6 +398,29 @@ function _setup_amavis() {
sed -i 's/^#\$myhostname = "mail.example.com";/\$myhostname = "'$HOSTNAME'";/' /etc/amavis/conf.d/05-node_id sed -i 's/^#\$myhostname = "mail.example.com";/\$myhostname = "'$HOSTNAME'";/' /etc/amavis/conf.d/05-node_id
} }
function _setup_dmarc() {
notify 'task' 'Setting up dmarc'
notify 'inf' "Applying hostname to /etc/opendmarc.conf"
sed -i -e 's/^AuthservID.*$/AuthservID '$HOSTNAME'/g' \
-e 's/^TrustedAuthservIDs.*$/TrustedAuthservIDs '$HOSTNAME'/g' /etc/opendmarc.conf
}
function _setup_postfix_hostname() {
notify 'task' 'Applying hostname and domainname to postfix/main.cf'
notify 'inf' "Applying hostname to /etc/postfix/main.cf"
postconf -e "myhostname = $HOSTNAME"
postconf -e "mydomain = $DOMAINNAME"
}
function _setup_dovecot_hostname() {
notify 'task' 'Applying hostname to Dovecot'
notify 'inf' "Applying hostname to /etc/postfix/main.cf"
sed -e 's/^#hostname =.*$/hostname = '$HOSTNAME'/g' /etc/dovecot/conf.d/15-lda.conf
}
function _setup_dovecot() { function _setup_dovecot() {
notify 'task' 'Setting up Dovecot' notify 'task' 'Setting up Dovecot'