Table of Contents
Why Self-Host Email?
For businesses with compliance requirements, maximum privacy needs, or who want to avoid per-user costs of hosted email services, a self-hosted email server provides complete control. However, running a mail server requires careful configuration — improperly configured mail servers end up in spam folders or get their IPs blacklisted.
Prerequisites
- A VPS with a dedicated IP (not shared)
- Clean IP reputation (verify at MXToolbox)
- A domain with DNS access
- Reverse DNS (PTR record) configured by your hosting provider
Install Postfix (MTA)
apt install postfix -y
# Select "Internet Site" during installation
# Enter your mail domain (e.g., powerdown.in)Configure SPF Record
Add a TXT record to your DNS: v=spf1 ip4:YOUR_SERVER_IP ~all. This tells receiving mail servers that your IP is authorized to send email for your domain.
Set Up DKIM Signing
apt install opendkim opendkim-tools -y
opendkim-genkey -t -s mail -d yourdomain.com
# Add the generated public key as a DNS TXT recordConfigure DMARC
Add a DNS TXT record at _dmarc.yourdomain.com: v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com
Install Dovecot (IMAP Server)
apt install dovecot-core dovecot-imapd -yFAQ
Will my emails go to spam?
With properly configured SPF, DKIM, DMARC, and a clean IP reputation, your deliverability to major providers (Gmail, Outlook, Yahoo) should be excellent. Monitor your IP with Google Postmaster Tools and Microsoft SNDS.
Ready to deploy?
Get a Clean IP VPS for Your Mail Server
Power Down VPS with dedicated IPv4 and clean IP reputation — ideal for email hosting.
