Docker Image for Smarthost (SMTP relay) based on official Alpine image
10K+
This Docker image is managed and kept up to date by epicsoft LLC.
Smarthost based on official alpine image.
This Docker image uses postfix to create an SMTP relay.
Docker Image for Smarthost (SMTP relay) based on official Alpine image.
This image can be used
latest based on alpine:latest - build weekly
SMARTHOST_HOST The remote SMTP server address requiredSMARTHOST_PORT The remote SMTP server port (default: 587)SMARTHOST_USER The username to authenticate with the remote SMTP server requiredSMARTHOST_PASSWORD The password to authenticate with the remote SMTP server requiredSMARTHOST_DOMAIN The domain to append to mails requiredSMARTHOST_TLS_SECURITY_LEVEL Configuring TLS support (default may)SMARTHOST_NETWORKS The list of trusted remote SMTP clients, comma separated without spaces (default: 192.168.0.0/16,172.16.0.0/12)SMARTHOST_ADD_MISSING_HEADERS Add headers when not present (default: true)SMARTHOST_FORCE_FROM Replaces the from address with the specified one (default: empty)From: header only, not the envelope sender$ in the value is taken literally, no escaping neededSMARTHOST_INIT_ALIAS_DATABASE Initialize the alias database (default: true)TZ Defines the time zone for the Docker container (default: unset)SMARTHOST_TLS_SECURITY_LEVEL - possible values:
none - No TLSmay - Opportunistic TLSencrypt - Mandatory TLS encryptiondane - Opportunistic DANE TLSdane-only - Mandatory DANE TLSfingerprint - Certificate fingerprint verificationverify - Mandatory server certificate verificationsecure - Secure-channel TLSEvery variable listed with a default must not be set to an empty value - the container
refuses to start. On port 465 (implicit TLS) SMARTHOST_TLS_SECURITY_LEVEL is ignored:
the connection is always wrapped in TLS and the level is forced to encrypt.
The container validates its configuration before starting Postfix and exits with a distinct code per missing variable:
| Code | Variable |
|---|---|
101 | SMARTHOST_HOST |
102 | SMARTHOST_PORT |
103 | SMARTHOST_USER |
104 | SMARTHOST_PASSWORD |
105 | SMARTHOST_TLS_SECURITY_LEVEL |
106 | SMARTHOST_NETWORKS |
107 | SMARTHOST_DOMAIN |
108 | SMARTHOST_ADD_MISSING_HEADERS |
109 | any of the above, or SMARTHOST_FORCE_FROM, given as more than one line |
No value may span more than one line. A second line would become a further entry in the generated Postfix map - another set of relay credentials, or another header rewrite rule.
docker run --rm -it \
--name smarthost \
-e SMARTHOST_HOST=mail.your-business.ge \
-e SMARTHOST_PORT=465 \
-e [email protected] \
-e SMARTHOST_PASSWORD=mySecretPassword \
-e SMARTHOST_DOMAIN=your-business.ge \
-e SMARTHOST_FORCE_FROM="Your Business LLC <[email protected]>" \
-e SMARTHOST_ADD_MISSING_HEADERS="true" \
epicsoft/smarthost:latest
MIT License see LICENSE
Please note that the MIT license only applies to the files created by epicsoft LLC. Other software may be licensed under other licenses.
Content type
Image
Digest
sha256:24df539ec…
Size
9.9 MB
Last updated
7 days ago
docker pull epicsoft/smarthost