Sign inSign up

dnknth/alpine-postfix

By dnknth

Updated about 1 year ago

Minimal Postfix with relay support

Image
0

1.4K

dnknth/alpine-postfix repository overview

What's this?

A very minimal Postfix image for Docker with relay support. It provides outbound SMTP only, to get mails out of Docker. The image is optimized for size (< 10MB) and simplicity.

Logging is done on the host system by mounting /dev/log into the container.

Usage

Start Postfix standalone (to send emails from containers)

    docker run --rm --name=postfix \
        -e  MTP_HOST=foo.com \
        -v /dev/log:/dev/log \
        dnknth/alpine-postfix

Or use a remote relay 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 \
        -v /dev/log:/dev/log \
        dnknth/alpine-postfix

Send emails:

    docker exec -it postfix mail [email protected]

Supported environment variables

  • MTP_HOST: The myhostname parameter specifies the internet hostname of this mail system (localhost)
  • MTP_DESTINATION: The mydestination parameter specifies the list of domains that this machine considers itself the final destination for.
  • MTP_BANNER: The smtpd_banner parameter specifies the text that follows the 220 code in the SMTP server's greeting banner.
  • MTP_RELAY: The relayhost parameter specifies the default host to send mail to when no entry is matched in the optional transport(5) table.
  • MTP_RELAY_DOMAINS: The relay_domains parameter restricts what destinations this system will relay mail to.
  • MTP_PORT: The relayhost port
  • MTP_USER: The user used to connect to the relayhost
  • MTP_PASS: The password used to connect to the relayhost
  • MTP_INTERFACES: The inet_interfaces parameter specifies the network interface addresses that this mail system receives mail on.

Tag summary

Content type

Image

Digest

sha256:0a37b54e6

Size

9.1 MB

Last updated

about 1 year ago

docker pull dnknth/alpine-postfix