No description
Find a file
2025-02-08 23:15:40 +00:00
docker-entrypoint.sh Initial commit 2025-02-08 23:08:10 +00:00
Dockerfile Initial commit 2025-02-08 23:08:10 +00:00
README.md Add README.md 2025-02-08 23:15:40 +00:00
runcmt.txt Initial commit 2025-02-08 23:08:10 +00:00

docker-postfix

Simple Docker image to run a Postfix MTA in relay mode


This is a simple, Alpine-based image that runs Postfix in relay mode - ie. it accepts incoming mail and forwards it onto a remote SMTP server somewhere else for further processing.

You might want to do this in the instance where you have a lot of services on one machine that send email and you want one neat and tidy exit point for emails in your system.

Use

This image can be found at registry.git.tdpain.net/pkg/docker-postfix.

It is configured using environment variables:

  • POSTFIX_SENDER_DOMAINS: a whitespace-delimited list of domains to accept within the From header of the email, eg. akpain.net tdpain.net
  • POSTFIX_HOSTNAME: the hostname of this instance of Postfix
  • POSTFIX_RELAY_HOST: the hostname of the upstream relay to forward mail to, eg: smtp.fastmail.com:587
  • POSTFIX_RELAY_USER: username for the relay server
  • POSTFIX_RELAY_PASSWORD: password for the relay server

Prior art

This was directly descended from https://xc2.wb1.xyz/post/how-to-run-a-postfix-mail-server-in-a-docker-container/ and indirectly from https://github.com/bokysan/docker-postfix.