6 hours ago
- Hosting your own email server is feasible using a simple SMTP-only setup, bypassing IMAP and using existing email forwarding for receiving.
- Essential requirements include a domain name and a 24/7 server, preferably a fixed-IP VPS, avoiding home servers with dynamic IPs.
- Preparation involves unblocking port 25 from your hosting provider, checking IP reputation, and hardening server security.
- Configure DNS with an A record for your mail server hostname, then set up email forwarding via your domain registrar for receiving.
- Deploy a Postfix container (e.g., boky/postfix) with Docker, exposing only on localhost for security, and enable DKIM key auto-generation.
- Run a test email script; expect bounces initially, which will resolve after completing DNS and reputation configurations.
- Set up reverse DNS with your hosting provider to match your mail server hostname to its IP address, establishing a DNS loop.
- Add a DKIM TXT record using the public key from the container's generated key files, ensuring selector uniqueness if multiple DKIM records exist.
- Create an SPF TXT record with your server's IP and hard fail policy, merging with existing SPF records if necessary.
- Configure a DMARC TXT record with 'reject' policy and alignment modes, optionally enabling reporting via services like Postmark.
- Be patient as email servers build trust over time; use testing tools like Mail Tester and EasyDMARC to monitor deliverability and fix issues.