8000 GitHub - fruitl00p/docker-postfix: Postfix with smtp authentication (sasldb), TLS, DKIM, in a docker container
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fruitl00p/docker-postfix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Build Status Docker Cloud Automated build GitHub Tag GitHub License GitHub language count GitHub top language Docker Pulls Docker Stars

docker-postfix

Postfix in a container with optional SMTP authentication (sasldb), DKIM support, TLS support.

Installation

Pull from docker hub

docker pull kingsquare/postfix

Build local image from repo

docker build -t kingsquare/postfix https://github.com/kingsquare/docker-postfix.git

Usage

  1. Create postfix container with smtp authentication

    docker run \
        -p 25:25 \
        -p 587:587 \
        -e maildomain=mail.example.com \
        -e smtp_user=user:pwd \
        --name postfix \
        -d kingsquare/postfix
    
    # Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN
  2. Create postfix container with smtp authentication

    docker run \
        -p 25:25 \
        -p 587:587 \
        -e maildomain=mail.example.com \
        -e smtp_user=/etc/postfix/smtp_user \
        --name postfix \
        -d kingsquare/postfix
    
    # Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN
    
    # Set multiple user credentials from file: -v /some/file:/etc/postfix/smtp_users
    
  3. Enable OpenDKIM: save your domain key .private in /path/to/domainkeys

    docker run \
        -p 25:25 \
        -p 587:587 \
        -e maildomain=mail.example.com \
        -e smtp_user=user:pwd \
        -e dkimselector=mail \
        -v /path/to/domainkeys:/etc/opendkim/domainkeys \
        --name postfix \
        -d kingsquare/postfix
  4. Enable OpenDKIM: override all config with custom directory

    docker run \
        -p 25:25 \
        -p 587:587 \
        -e maildomain=mail.example.com \
        -e smtp_user=user:pwd \
        -e dkimselector=mail \
        -v /path/to/etc/opendkim:/etc/opendkim \
        --name postfix \
        -d kingsquare/postfix
  5. Enable TLS: add your SSL certificates .key and .crt files to /path/to/certs. If you have a combined crt+key file then make sure it's extension is .crt

    docker run \
        -p 25:25 \
        -p 587:587 \
        -e maildomain=mail.example.com \
        -e smtp_user=user:pwd \
        -v /path/to/certs:/etc/postfix/certs \
        --name postfix \
        -d kingsquare/postfix

Notes

  • Login credential should be set to (username@mail.example.com, password) in SMTP Client
  • You can assign the port of MTA on the host machine to one other than 25 (postfix how-to)
  • Read the reference below to find out how to generate domain keys and add public key to the domain's DNS records

Reference

About

Postfix with smtp authentication (sasldb), TLS, DKIM, in a docker container

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 89.7%
  • Dockerfile 10.3%
0