24 lines
914 B
Bash
24 lines
914 B
Bash
#!/bin/bash
|
|
|
|
# Update hostname if given
|
|
if [ -f /mail_settings/myhostname ]; then
|
|
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
|
|
fi
|
|
|
|
readarray -t domains < /mail_settings/domains
|
|
first_fqdn="\$myhostname = \"${domains[0]}\";"
|
|
domain_string=$(printf "'%s' " "${domains[@]}") | tr ' ' ,
|
|
domain_acl="@local_domains_acl = ( $domain_string );"
|
|
|
|
sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/05-node_id -i
|
|
sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/50-user -i
|
|
sed "/# DOCKERMAIL DOMAINS START/a $first_fqdn" /etc/amavis/conf.d/05-node_id -i
|
|
sed "/# DOCKERMAIL DOMAINS START/a $domain_acl" /etc/amavis/conf.d/50-user -i
|
|
|
|
|
|
ln -sf /dev/stdout /var/log/razor-agent.log
|
|
ln -sf /dev/stdout /var/log/mail.log
|
|
ln -sf /dev/stdout /var/log/mail.info
|
|
ln -sf /dev/stdout /var/log/mail.warn
|
|
ln -sf /dev/stderr /var/log/mail.err
|