Simple postfix container for sending emails and forwarding incoming emails
720
run postfix with smtp authentication (sasldb) in a docker container. TLS and OpenDKIM support are optional.
Build image
$ sudo docker pull stempler/postfix
Create postfix container with smtp authentication
$ sudo docker run -p 25:25 \
-e maildomain=mail.example.com -e smtp_user=user:pwd \
--name postfix -d stempler/postfix
# Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN
Enable OpenDKIM: save your domain key .private in /path/to/domainkeys. Note that the image assumes mail as the name of the selector of the domain key.
$ sudo docker run -p 25:25 \
-e maildomain=mail.example.com -e smtp_user=user:pwd \
-v /path/to/domainkeys:/etc/opendkim/domainkeys \
--name postfix -d stempler/postfix
Enable TLS(587): save your SSL certificates .key and .crt to /path/to/certs
$ sudo docker run -p 587:587 \
-e maildomain=mail.example.com -e smtp_user=user:pwd \
-v /path/to/certs:/etc/postfix/certs \
--name postfix -d stempler/postfix
To enable simple mail forwarding for the whole mail domain to
an external address, use the mail_forward_to environment variable,
for example:
[email protected], password) in Smtp ClientContent type
Image
Digest
Size
97 MB
Last updated
over 10 years ago
docker pull stempler/postfix