docker-postfix
by bokysan
A lightweight, multi-architecture Postfix null relay SMTP server container optimized for Docker and Kubernetes environments.
Multi architecture simple SMTP server (postfix null relay) host for your Docker and Kubernetes containers. Based on Debian/Ubuntu/Alpine.
Primary Use Case
docker-postfix is designed to provide a simple and configurable SMTP relay host for containerized applications running in Docker or Kubernetes. It is ideal for developers and DevOps teams who need to route outbound emails securely and efficiently without managing a full mail server. The tool supports multiple Linux base images and advanced features like DKIM signing and OAuth2 authentication.
- Multi-architecture support with Debian, Ubuntu, and Alpine base images
- Configurable Postfix null client relay host for containerized environments
- Supports OAuth2 authentication for SMTP relay (e.g., Gmail)
- DKIM signing with options for custom or auto-generated keys
- Flexible configuration via environment variables for relay host, sender domains, and security settings
- Inbound debugging and detailed logging options
- Email anonymization filters for privacy
- Customizable Postfix and OpenDKIM settings
Installation
- Pull the Docker image from Docker Hub: docker pull boky/postfix
- Choose your preferred base image variant (Debian, Ubuntu, Alpine) if needed
- Configure environment variables such as RELAYHOST, RELAYHOST_USERNAME, and RELAYHOST_PASSWORD
- Optionally set up DKIM keys or enable auto-generation within the container
- Run the container in your Docker or Kubernetes environment with appropriate volume mounts and network settings
- Monitor logs and adjust configuration as needed for your email relay requirements
Usage
>_ docker run -e RELAYHOST=smtp.example.com -e RELAYHOST_USERNAME=user -e RELAYHOST_PASSWORD=pass boky/postfixRun the postfix relay container with specified SMTP relay host and credentials
>_ docker run -e ALLOWED_SENDER_DOMAINS=example.com boky/postfixRestrict allowed sender domains to example.com for outbound emails
>_ docker run -e XOAUTH2_CLIENT_ID=xxx -e XOAUTH2_SECRET=yyy -e XOAUTH2_INITIAL_ACCESS_TOKEN=zzz boky/postfixConfigure OAuth2 authentication for SMTP relay, e.g., Gmail
>_ docker run -e DKIM_SELECTOR=default -v /path/to/dkim/keys:/etc/opendkim/keys boky/postfixUse custom DKIM keys mounted into the container for email signing
>_ docker run -e ANONYMIZE_EMAILS=smart boky/postfixEnable smart anonymization filter for outgoing emails
- Integrate docker-postfix in Kubernetes clusters to centralize and secure outbound email traffic with DKIM and OAuth2 authentication.
- Use environment variables to automate configuration in CI/CD pipelines for dynamic email relay setups.
- Leverage inbound debugging and detailed logging for rapid incident investigation and anomaly detection in email flows.
- Combine with email security gateways and SIEM tools to enhance detection of phishing and spoofing attempts.
- Deploy email anonymization filters to protect sensitive information and comply with privacy regulations in automated email workflows.
Docs Take 2 Hours. AI Takes 10 Seconds.
Ask anything about docker-postfix. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.
This tool hasn't been indexed yet. Request indexing to enable AI chat.
Admin will review your request within 24 hours
Related Tools

mailcow-dockerized
mailcow/mailcow-dockerized
mailcow: dockerized - 🐮 + 🐋 = 💕
espoofer
chenjj/espoofer
An email spoofing testing tool that aims to bypass SPF/DKIM/DMARC and forge DKIM signatures.🍻
Spoofy
MattKeeley/Spoofy
Spoofy is a program that checks if a list of domains can be spoofed based on SPF and DMARC records.
sublime-rules
sublime-security/sublime-rules
Sublime rules for email attack detection, prevention, and threat hunting.
spamscope
SpamScope/spamscope
Fast Advanced Spam Analysis Tool
EmailAnalyzer
keraattin/EmailAnalyzer
With EmailAnalyzer you can analyze your suspicious emails. You can extract headers, links, and hashes from the .eml file and you can generate reports.
