2015-07-12 22:54:35 +00:00
|
|
|
#!/bin/bash
|
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
|