exherbo-dockermail/amavis/boot
2015-07-25 04:06:58 +01:00

17 lines
718 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