From c40145803405fc424be5d76c30fbcc13631673ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20AUGUSTE?= Date: Tue, 19 Apr 2016 22:40:40 +0200 Subject: [PATCH] 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. --- start-mailserver.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/start-mailserver.sh b/start-mailserver.sh index 787c8c72..07818277 100644 --- a/start-mailserver.sh +++ b/start-mailserver.sh @@ -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"