🐳Dockerized postfix which relays emails to SendGrid. Just adding some environment variables, you can setup the container.
Note: This image is made for send-only mail server.
- 📩 Realy emails to SendGrid
- 🔐 SMTP Auth with username and password
- ✅ SMTP Auth with LDAP
- 📇 Sender Canonical
Just pull the image and run the container with environment variables.
You need to provide the hostname of the container to give the postfix hostname, otherwise it uses the container ID as a hostname.
For example,
docker run -d --hostname example.com -e SENDGRID_API_KEY=<YOUR_API_KEY> -e SMTP_USER=user -e SMTP_PASSWORD=abcdef -p 25:25 -p 587:587 ghcr.io/seieric/postfix-sendgrid-relay-docker:latest
Your SENDGRID's API key. The container wouldn't start if not set.
If none of the following variables are set, you can use only port 25.
Just create a single account with SMTP_USER and SMTP_PASSWORD.
User for SMTP AUTH. If not set, you cannot use submission port 587. Must be used with SMTP_PASSWORD.
Password for SMTP AUTH. If not set, you cannot use submission port 587. Must be used with SMTP_USER.
Use LDAP authentication for SMTP AUTH. You need to set the following variables.
If you configure LDAP authentication, SMTP_USER and SMTP_PASSWORD will be ignored.
Name(* Required) | Description |
---|---|
LDAP_SERVER* | LDAP server address. For example, ldap://127.0.0.1 or ldaps://ldap.example.com . You can set multiple servers. |
LDAP_BIND_DN* | LDAP bind DN. |
LDAP_BIND_PW* | LDAP bind password. |
LDAP_SEARCH_BASE* | LDAP search base. For example, ou=accounts,dc=example,dc=com . |
LDAP_SEARCH_FILTER | LDAP search filter. Default is (&(objectClass=inetOrgPerson)(uid=%U)) . |
This image supports sender canonical feature included in postfix.
To use this feature, just mount your sender canonical file to /etc/postfix/sender_canonical
The startup script automatically detects the file and enable the feature.