Skip to content

sashkab/docker-postfix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postfix in a docker container

There are many docker images available for postfix, but I could not fine one which will satisfy my needs. I've been using it for last year or so, so decided to release it publicly.

Warning

If configured incorrectly, this can become an open relay SMTP server, so hosting it on public interfaces is not advisable.

Why

If you have devices which can send notifications, but does not support SMTP authentication, or SMTP authentication is broken -- relay SMTP server can help. It will relay via upstream SMTP server. Received header will be hidden, so your internal network information won't leak.

Usage

Modify docker-compose.yml with your settings. Then:

docker-compose up -d

Configure email client to send email via your local SMTP server.

SSL

Generate Postfix SMTP server EDH parameters for improved security against pre-computation attacks:

openssl dhparam -out dh512.tmp 512 && mv dh512.tmp dh512.pem
openssl dhparam -out dh2048.tmp 2048 && mv dh2048.tmp dh2048.pem

Request SSL certificate from Let's Encrypt using lego or any other tool, and save certificate as cert.pem and private key as key.pem in the root of the repository.

Thanks

Some ideas where found and sometimes copied from the following projects:

Bug reports and pull requests

This is open source project. If you find a bug or have a suggestion, please open issue, or submit a pull request.