Postfix SMTP only Docker image with SMTP relay support.
- Rocky Linux: 9.3
- Postfix: 3.5.25
- Expose: 25
Important
Starting with the release 3.5-1.0, the MTP_USER and MTP_PASS variables became mandatory, as without them, emails are rejected as SPAM and are not sent
- :latestDockerfile - Rocky Linux: 9.3 Postfix: 3.5.25
- :3.5-1.1Dockerfile - Rocky Linux: 9.3 Postfix: 3.5.25
- :3.5-1.0Dockerfile - Rocky Linux: 9.3 Postfix: 3.5.9
- :2.10-3.8Dockerfile - CentOS: 7 Postfix: 2.10.1
See older versions
Start postfix (to send emails using postfix within container)
$ docker run --rm --name=postfix \
             -e  MTP_HOST=foo.com \
         eeacms/postfix
or start postfix (to send emails by using a remote email server)
$ docker run --rm --name=postfix \
             -e MTP_HOST=foo.com \
             -e MTP_RELAY=smtp.gmail.com \
             -e MTP_USER=foo \
             -e MTP_PASS=secret \
         eeacms/postfix
Start sending emails:
$ docker run -it --rm --link=postfix busybox sh
  $ telnet postfix 25
  HELO foo.com
  MAIL FROM: [email protected]
  RCPT TO: [email protected]
  DATA
  subject: Test
  Testing 1, 2, 3
  .
  quit
- MTP_HOSTThe- myhostnameparameter specifies the internet hostname of this mail system
- MTP_DESTINATIONThe- mydestinationparameter specifies the list of domains that this machine considers itself the final destination for.
- MTP_BANNERThe- smtpd_bannerparameter specifies the text that follows the 220 code in the SMTP server's greeting banner.
- MTP_RELAYThe- relayhostparameter specifies the default host to send mail to when no entry is matched in the optional transport(5) table.
- MTP_RELAY_DOMAINSThe- relay_domainsparameter restricts what destinations this system will relay mail to.
- MTP_PORTThe- relayhostport.
- MTP_USERThe user used to connect to the- relayhost.
- MTP_PASSThe password used to connect to the- relayhost.
- MTP_INTERFACESThe- inet_interfacesparameter specifies the network interface addresses that this mail system receives mail on.
- MTP_PROTOCOLSThe- inet_protocolsparameter specifies the network interface protocol. Can be set to- all,- ipv4,- ipv6or- ipv4,ipv6. The default value is- all.
- MTP_MS_SIZE_LIMITIf set, will configure email size limit.
- SMTPD_TLS_SECURITY_LEVELThe SMTP TLS security level for the Postfix SMTP server. Default value: none. Possible values: none(TLS will not be used), may( Opportunistic TLS), encrypt(Mandatory TLS encryption)
- SMTP_TLS_SECURITY_LEVELThe default SMTP TLS security level for the Postfix SMTP client. Default value: may. Possible values: none(TLS will not be used), may( Opportunistic TLS), encrypt(Mandatory TLS encryption)
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
The Original Code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.