Postfix config file --> /yourdir/main.cf
Certificate/key --> /youdir/ssl smtpd.crt smtpd.key auto-generated, can be replace by letsencrypt cert.
Users db --> /yourdir/sasldb2
$ touch /yourdir/sasldb2
$ docker run --restart=always -d -v /yourdir/main.cf:/main.cf -v /yourdir:/etc/postfix/ssl -v /yourdir/sasldb2:/etc/sasldb2 -p 587:587 -p 25:25 --name=postfix cvando/postfix
$ docker exec -it postfix saslpasswd2 -c -u domain.com username
$ docker exec -it postfix sasldblistusers2
encode username@domain to base64
encode password to base64
$ telnet localhost 25
EHLO test
AUTH LOGIN
[email protected]
password64
Content type
Image
Digest
Size
19.3 MB
Last updated
over 7 years ago
docker pull cvando/postfix:master