Automatic file `/etc/opendkim/TrustedHosts` creation if missing

Following issue #132, the script `start-mailserver.sh` now creates and populates `/etc/opendkim/TrustedHosts` with localhost information.
This allow for mounting an empty directory from the host for DKIM data persistence.
This commit is contained in:
Rémi AUGUSTE 2016-04-19 22:40:40 +02:00
parent b10e219ae4
commit c401458034
1 changed files with 7 additions and 0 deletions

View File

@ -116,6 +116,13 @@ grep -vE '^(\s*$|#)' /etc/postfix/vhost | while read domainname; do
echo $signingtableentry >> /etc/opendkim/SigningTable
fi
fi
# Creates TrustedHosts if missing
if [ ! -f "/etc/opendkim/TrustedHosts" ]; then
echo "Creating DKIM TrustedHosts";
echo "127.0.0.1" > /etc/opendkim/TrustedHosts
echo "localhost" >> /etc/opendkim/TrustedHosts
fi
done
echo "Changing permissions on /etc/opendkim"