From e4e0cc288f5003e76b8db8b57d9df7b35a273573 Mon Sep 17 00:00:00 2001 From: "l.barcaroli" Date: Tue, 6 Mar 2018 00:45:28 +0100 Subject: [PATCH 1/2] Adding support for secrets --- assets/install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/install.sh b/assets/install.sh index 0b2aaff..c1becb5 100755 --- a/assets/install.sh +++ b/assets/install.sh @@ -45,7 +45,11 @@ auxprop_plugin: sasldb mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM EOF # sasldb2 -echo $smtp_user | tr , \\n > /tmp/passwd +if [ -f /run/secrets/smtp_user ]; then + cat /run/secrets/smtp_user | tr , \\n > /tmp/passwd +else + echo $smtp_user | tr , \\n > /tmp/passwd +fi while IFS=':' read -r _user _pwd; do echo $_pwd | saslpasswd2 -p -c -u $maildomain $_user done < /tmp/passwd @@ -127,4 +131,4 @@ cat >> /etc/opendkim/SigningTable < Date: Tue, 6 Mar 2018 00:50:23 +0100 Subject: [PATCH 2/2] README updated accordingly to previous commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 955a64c..112453b 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ TLS and OpenDKIM support are optional. ## Note + Login credential should be set to (`username@mail.example.com`, `password`) in Smtp Client ++ If `smtp_user` is set to an existing file, the `user:password` string will be read from that file + (to allow integration with docker-swarm secrets). + You can assign the port of MTA on the host machine to one other than 25 ([postfix how-to](http://www.postfix.org/MULTI_INSTANCE_README.html)) + Read the reference below to find out how to generate domain keys and add public key to the domain's DNS records