- Build locally
- Environment variables
- Run as non-root user
- Latest msmtp/msmtpd release compiled from source
- Bind to unprivileged port
- Multi-platform image
git clone https://github.com/crazy-max/docker-msmtpd.git cd docker-msmtpd # Build image and output to docker (default) docker buildx bake # Build multi-platform image docker buildx bake image-all
|GitHub Container Registry||
Following platforms for this image are available:
$ docker run --rm mplatform/mquery crazymax/msmtpd:latest Image: crazymax/msmtpd:latest * Manifest List: Yes * Supported platforms: - linux/amd64 - linux/arm/v6 - linux/arm/v7 - linux/arm64 - linux/386 - linux/ppc64le - linux/s390x
TZ: Timezone assigned to the container (default
PUID: Daemon user id (default
PGID: Daemon group id (default
SMTP_HOST: SMTP relay server to send the mail to. required
SMTP_PORT: Port that the SMTP relay server listens on. Default
SMTP_TLS: Enable or disable TLS (also known as SSL) for secured connections (
SMTP_STARTTLS: Start TLS from within the session (
on, default), or tunnel the session through TLS (
SMTP_TLS_CHECKCERT: Enable or disable checks of the server certificate (
off). They are enabled by default.
SMTP_AUTH: Enable or disable authentication and optionally choose a method to use. The argument
onchooses a method automatically.
SMTP_USER: Set the username for authentication. Authentication must be activated with the
SMTP_PASSWORD: Set the password for authentication. Authentication must be activated with the
SMTP_DOMAIN: Argument of the
SMTP EHLOcommand (default
SMTP_FROM: Set the envelope-from address. Supported substitution patterns can be found here.
SMTP_SET_FROM_HEADER: When to set a From header. Can be
SMTP_SET_DATE_HEADER: When to set a Date header. Can be
SMTP_REMOVE_BCC_HEADERS: Controls whether to remove Bcc headers. Can be
SMTP_UNDISCLOSED_RECIPIENTS: When set, the original To, Cc, and Bcc headers of the mail are removed and a single new header line
To: undisclosed-recipients:;is added. Can be
SMTP_DSN_NOTIFY: Set the condition(s) under which the mail system should send DSN (Delivery Status Notification) messages as comma separated values. Available values are
SMTP_DSN_RETURN: Controls how much of a mail should be returned in DSN (Delivery Status Notification) messages. Can be
SMTP_PASSWORD_FILEcan be used to fill in the value from a file, especially for Docker's secrets feature.
💡More info: https://marlam.de/msmtp/msmtp.html
2500: SMTP relay port
Docker compose is the recommended way to run this image. You can use the following docker compose template, then run the container:
docker-compose up -d docker-compose logs -f
To install on a Kubernetes cluster, you can use the following kubernetes deployment template, then create the deployment:
kubectl apply -f deployment.yaml
You can also use the following minimal command:
$ docker run -d -p 2500:2500 --name msmtpd \ -e "SMTP_HOST=smtp.example.com" \ crazymax/msmtpd
Recreate the container whenever I push an update:
docker-compose pull docker-compose up -d
Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!
Thanks again for your support, it is much appreciated!
LICENSE for more details.