crazy-max/docker-msmtpd
crazy-max/docker-msmtpd has 129 GitHub stars and 17 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-16 19:08 UTC. Last push 2026-11-14.
What you can do
- Run as non-root user
- Latest msmtp/msmtpd release compiled from source
- Bind to unprivileged port
- Multi-platform image
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Lightweight SMTP relay Docker image using msmtpd
Developer ToolsREADME.md
OriginalAbout
Lightweight SMTP relay using msmtpd as a Docker image.
[!TIP] Want to be notified of new releases? Check out 🔔 Diun (Docker Image Update Notifier) project!
Features
- Run as non-root user
- Latest msmtp/msmtpd release compiled from source
- Bind to unprivileged port
- Multi-platform image
Build locally
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
Image
| Registry | Image |
|---|---|
| Docker Hub | crazymax/msmtpd |
| GitHub Container Registry | ghcr.io/crazy-max/msmtpd |
Following platforms for this image are available:
$ docker buildx imagetools inspect crazymax/msmtpd --format "{{json .Manifest}}" | \
jq -r '.manifests[] | select(.platform.os != null and .platform.os != "unknown") | .platform | "\(.os)/\(.architecture)\(if .variant then "/" + .variant else "" end)"'
linux/amd64
linux/arm/v6
linux/arm/v7
linux/arm64
linux/ppc64le
linux/s390x
Environment variables
TZ: Timezone assigned to the container (defaultUTC)PUID: Daemon user id (default1500)PGID: Daemon group id (default1500)LISTEN_PORT: Container listen port for msmtpd, useful with host, macvlan, or ipvlan networking (default2500)SMTP_HOST: SMTP relay server to send the mail to. requiredSMTP_PORT: Port that the SMTP relay server listens on. Default25or465if TLS.SMTP_TLS: Enable or disable TLS (also known as SSL) for secured connections (onoroff).SMTP_STARTTLS: Start TLS from within the session (on, default), or tunnel the session through TLS (off).SMTP_TLS_CHECKCERT: Enable or disable checks of the server certificate (onoroff). They are enabled by default.SMTP_AUTH: Enable or disable authentication and optionally choose a method to use. The argumentonchooses a method automatically.SMTP_USER: Set the username for authentication. Authentication must be activated with theSMTP_AUTHenv var.SMTP_PASSWORD: Set the password for authentication. Authentication must be activated with theSMTP_AUTHenv var.SMTP_DOMAIN: Argument of theSMTP EHLOcommand (defaultlocalhost)SMTP_FROM: Set the envelope-from address. Supported substitution patterns can be found here.SMTP_FROM_FULL_NAME: Set the full name to use in the From header when msmtp adds one.SMTP_ALLOW_FROM_OVERRIDE: Allow configured envelope-from address to be overriden by actual SMTP MAIL FROM . Can beonoroff(defaulton)SMTP_SET_FROM_HEADER: When to set a From header. Can beauto,onoroff(defaultauto)SMTP_SET_DATE_HEADER: When to set a Date header. Can beautooroff(defaultauto)SMTP_REMOVE_BCC_HEADERS: Controls whether to remove Bcc headers. Can beonoroff(defaulton)SMTP_UNDISCLOSED_RECIPIENTS: When set, the original To, Cc, and Bcc headers of the mail are removed and a single new header lineTo: undisclosed-recipients:;is added. Can beonoroff(defaultoff)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 areoff,never,failure,delayandsuccess(defaultoff)SMTP_DSN_RETURN: Controls how much of a mail should be returned in DSN (Delivery Status Notification) messages. Can beheaders,fulloroff(defaultoff)
[!NOTE]
SMTP_USER_FILEandSMTP_PASSWORD_FILEcan be used to fill in the value from a file, especially for Docker's secrets feature.
[!NOTE] More info: https://marlam.de/msmtp/msmtp.html
Ports
2500: SMTP relay port, configurable throughLISTEN_PORT
Usage
Docker Compose
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
Kubernetes
To install on a Kubernetes cluster, you can use the following kubernetes deployment template, then create the deployment:
kubectl apply -f deployment.yaml
Command line
You can also use the following minimal command:
$ docker run -d -p 2500:2500 --name msmtpd \
-e "SMTP_HOST=smtp.example.com" \
crazymax/msmtpd
Upgrade
Recreate the container whenever I push an update:
docker compose pull
docker compose up -d
Contributing
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! :pray:
License
MIT. See LICENSE for more details.
