Public | Automated Build

Last pushed: 2 years ago
Short Description
For our office
Full Description

Versatile Postfix Mail Server (marvambass/versatile-postfix)

forked and maintained by Ron Arts

FAQ - All you need to know about the marvambass Containers

What is it

This Dockerfile (available as marvambass/versatile-postfix) gives you a completly versatile postfix

It signs outgoing mails with DKIM by default. You can create one Domain with different users with their passwords. For multiple Domains you need to use multiple containers or create your own fork of this project.

This is not a POP3 or IMAP server, you will get incomming E-Mails in the Maildir format. Read it with less or link a IMAP Server to the volume.

View in Docker Registry marvambass/versatile-postfix

View in GitHub MarvAmBass/docker-versatile-postfix

Environment variables and defaults

    • optional, no default, example usage: "postmaster:root;john:root;j.doe:root"
    • default: not set - if set to any value the DKIM Signing will be deactivated
    • default: simple - can be either relaxed or simple

Running the Mailserver

This Dockerfile is build to be as versatile as possible.
Therefore the startup script takes care of all the important things.

You can easily create a new Mailserver for a domain with several users.

Keep in mind, this is a smtp server only.
To read recievied mails you should link a folder inside the conatiner.
Otherwise all mails will get lost after you delete your container.

To create a new postfix server for your domain you should use the following commands:

docker run -p 25:25 -v /maildirs:/var/mail \
    -v /dkim:/etc/postfix/dkim/ \
    -e 'ALIASES=postmaster:root;hostmaster:root;webmaster:root' \
    marvambass/versatile-postfix \ \
    user:password \
    user1:password \
    user2:password \

this creates a new smtp server which listens on port _25_, stores mail beneath /mailsdirs.

The /dkim directory has to contain a DKIM-Key (see above) with the name dkim.key

It has serveral user accounts like user1 with password "password" and
a mail address _user1@yourdomain.com_


This Server uses DKIM by default. So we need our DKIM Keys.
If you don't have a DKIM Key, the Server will generate it on the first start.
Just be sure, that you make the directory /etc/postfix/dkim/ available and
install the logged public key to your DNS System

More about DKIM

To generate those keys you'll need the opendkim tools

apt-get install opendkim-tools

This generates a new certificate for with selector (_-s_) mail. If you want to Test DKIM first, add _-t_ argument which stands for test-mode.

opendkim-genkey -s mail -d

Just put the file mail.private as dkim.key inside the dkim directory you'll later link into the container using _-v_.

The mail.txt should be imported into the DNS System. Add a new TXT-Record for mail._domainkey [selector._domainkey]. And add as value the String starting "v=DKIM1;..." from the mail.txt file.

Thats all you need for DKIM

Testing SMTP Mail recivieing

$ mailx -r "" -s "Test Mail Subject" < /etc/hosts

Testing the SMTP Auth and SMTP sending via telnet:

$ echo -ne '\0user\0password' | openssl enc -base64

$ telnet 25
Connected to
Escape character is '^]'.
ehlo test
250-SIZE 10240000
auth plain AHVzZXIAcGFzc3dvcmQ=
235 Authentication successful
mail from:
250 2.1.0 Ok
rcpt to:
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
Hi there
this is just a basic test message
250 2.0.0 Ok: queued as 2E7FB27F
221 Bye
Connection closed by foreign host.


DKIM Keycheck

DKIM more Infos and signature check

Docker Pull Command
Source Repository