Skip to content

Adding support for secrets in docker swarm #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ TLS and OpenDKIM support are optional.

## Note
+ Login credential should be set to (`[email protected]`, `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

Expand Down
8 changes: 6 additions & 2 deletions assets/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,4 +131,4 @@ cat >> /etc/opendkim/SigningTable <<EOF
*@$maildomain mail._domainkey.$maildomain
EOF
chown opendkim:opendkim $(find /etc/opendkim/domainkeys -iname *.private)
chmod 400 $(find /etc/opendkim/domainkeys -iname *.private)
chmod 400 $(find /etc/opendkim/domainkeys -iname *.private)