exherbo-dockermail/amavis/boot

13 lines
476 B
Bash

#!/bin/bash
if [ -f /mail_settings/myhostname ]; then
echo $(sed 's:/:\\/:g' /mail_settings/myhostname) > /etc/mailname
fi
readarray -t domains < /mail_settings/domains
domain_suffix=$(printf ", \"%s\"" "${domains[@]}")
domain_string="@local_domains_acl = ( \".$mydomain\" $domain_suffix );"
sed "/# DOCKERMAIL DOMAINS START/,/# DOCKERMAIL DOMAINS END/{//!d}" /etc/amavis/conf.d/50-user -i
sed "/# DOCKERMAIL DOMAINS START/a $domain_string/" /etc/amavis/conf.d/50-user -i