Production ready Mail Transport Agent Container using Postfix
6.7K
Production ready Mail Transport Agent Container using Postfix
3.10.X-BUILD, 3.10.X, 3.10, 3, latestWhere X is the patch version number, and BUILD is the build number (look into project Tags page to discover the latest versions)
MULTISERVICE variablePostfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.
It is released under the IBM Public License 1.0 which is a free software license. Alternatively, starting with version 3.2.5, it is available under the Eclipse Public License 2.0 at the user's option.
Originally written in 1997 by Wietse Venema at the IBM Thomas J. Watson Research Center in New York, and first released in December 1998[3], Postfix continues as of 2018 to be actively developed by its creator and other contributors. The software is also known by its former names VMailer and IBM Secure Mailer.
In a December 2017 study performed by E-Soft, Inc., approximately 34% of the publicly reachable mail-servers on the Internet ran Postfix.

docker pull izdock/postfix
docker run -it --rm izdock/postfix
You can test it by configuring your smtp client to use container-ip:25 or container-ip:465 or container-ip:587
If you need access outside the host, on port 25, 465, 587:
docker run -it --rm -p 25:25 -p 465:465 -p 587:587 izdock/postfix
Follow all usable runtime environment variables with default values
: ${MULTISERVICE:="false"}
postfix start-fg), the mail log goes to stdout/var/log/mail/current (rotated by svlogd) and copied
to stderr, so a log shipper sidecar (eg. fluent-bit) can read the file sharing /var/log/mail: ${file_master_cf:="/etc/postfix/master.cf"}
: ${file_main_cf:="/etc/postfix/main.cf"}
: ${file_allowed_senders:="/etc/postfix/allowed_senders"}
: ${file_header_checks:="/etc/postfix/header_checks"}
: ${file_sasl_passwd:="/etc/postfix/sasl_passwd"}
: ${file_aliases:="/etc/aliases"}
: ${aliases_root:="root"}
: ${mydomain:="$HOSTNAME"}
: ${myhostname:="$HOSTNAME"}
: ${mydestination:="$myhostname, localhost.$mydomain, localhost"}
: ${myorigin:="$mydomain"}
: ${mynetworks:="127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
: ${relay_domains:=""}
: ${allowed_senders_domains:=""}
: ${relayhost:=""}
: ${relayhost_password:=""}
: ${relayhost_username:=""}
: ${transport:="example.com smtp:[smtp.example1.com]:587;otherdomain.it smtp:[smtp.example2.com]:25"}
: ${mailbox_size_limit:=0}
: ${message_size_limit:=8000000}
: ${soft_bounce:="yes"}
: ${smtputf8_enable:="no"}
: ${smtp_sasl_auth_enable:="yes"}
: ${smtp_sasl_security_options:="noanonymous"}
: ${smtp_tls_security_level:="may"}
: ${smtpd_tls_security_level:="none"}
: ${smtpd_delay_reject:="yes"}
: ${smtpd_helo_required:="yes"}
: ${smtpd_helo_restrictions:="permit_mynetworks,reject_invalid_helo_hostname,permit"}
: ${smtpd_restriction_classes:="allowed_domains_only"}
: ${allowed_domains_only:="permit_mynetworks, reject_non_fqdn_sender reject"}
: ${smtpd_recipient_restrictions:="reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unverified_recipient"}
To customize the configuration just COPY your custom configuration in /etc/postfix/master.cf and /etc/postfix/main.cf.
FROM izdock/postfix
COPY ./master.cf /etc/postfix/master.cf
COPY ./main.cf /etc/postfix/main.cf
Dockerfile in your projectFROM izdock/postfix:latest
Then, run the commands to build and run the Docker image:
$ docker build --pull --rm -t postfix:local .
$ docker run --rm -it -p 2525:25 -p 2465:465 --name postfix postfix:local
The versions come from versions.env: APP_VER is the Postfix version of the
Debian package, the base image is debian:<DEBIAN_CODENAME>-slim@<DEBIAN_DIGEST>.
$ tools/build.sh # izdock/postfix:local, the same build args as CI (DOCKER=podman supported)
$ docker run -i --rm --entrypoint "" -e APP_VER_EXPECTED=<APP_VER> izdock/postfix:local bash -s < .gitea/actions/build-push/verify-image.sh
$ .gitea/actions/build-push/smoke-test.sh izdock/postfix:local
$ tools/make-updates.sh # new Debian digest or Postfix version available?
CI (Gitea Actions, .gitea/workflows): postfix-build lints, builds, verifies and publishes
every push to main (and rebuilds every Monday for the OS security updates), postfix-publish
publishes again a build already verified, postfix-updates opens every Sunday a pull request
with the new versions of versions.env.
Where to get help: InitZero Enterprise Support
Where to file issues: https://github.com/ugoviti
Maintained by: Ugo Viti
Supported architectures:
[amd64]
Supported Docker versions: the latest release (down to 1.6 on a best-effort basis)
View Eclipse Public License - v 2.0 and for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
Content type
Image
Digest
sha256:f66bfb68a…
Size
87 MB
Last updated
about 19 hours ago
docker pull izdock/postfix