exherbo-dockermail/amavis/boot

17 lines
718 B
Plaintext
Raw Normal View History

#!/bin/bash
2015-07-25 03:06:58 +00:00
# Update hostname if given
if [ -f /mail_settings/myhostname ]; then
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
fi
2015-07-14 22:37:13 +00:00
readarray -t domains < /mail_settings/domains
2015-07-25 01:24:55 +00:00
first_fqdn="\$myhostname = \"${domains[0]}\";"
domain_string=$(printf "'%s' " "${domains[@]}") | tr ' ' ,
domain_acl="@local_domains_acl = ( $domain_string );"
2015-07-14 22:37:13 +00:00
2015-07-25 01:24:55 +00:00
sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/05-node_id -i
2015-07-14 22:37:13 +00:00
sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/50-user -i
2015-07-25 01:24:55 +00:00
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