Tools: Setting Up a Production Mail Server on Ubuntu in 30 Minutes - Complete Guide
Setting Up a Production Mail Server on Ubuntu in 30 Minutes
Why 30 Minutes Is Not Enough
Prerequisites
Install KumoMTA
Configure DNS Records
Configure KumoMTA
Start and Test
Verify Authentication
The Warmup Phase Most tutorials for setting up a mail server result in emails landing in spam. This guide covers exactly what it takes to get a production-grade mail server running that actually delivers. A basic Postfix setup takes 30 minutes. A production setup that actually delivers to Gmail inbox takes longer because: This guide covers the 30-minute setup. Warmup is a separate 8-week process. Before sending anything, set up authentication: DKIM Record:
KumoMTA generates keys automatically. Add the public key to DNS with selector mail. Basic configuration for single domain: Before sending real email: After setup, you MUST warm up: PostMTA offers managed KumoMTA setup and warmup as a service. Starting at $200/month. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse
$ -weight: 500;">curl -1sLf \ 'https://repo.kumomta.com/gpg.67E7103C/key' | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/kumomta-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/kumomta-archive-keyring.gpg] https://repo.kumomta.com/ubuntu/ $(lsb_release -cs) main" \ | -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/kumomta.list -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update && -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install kumomta
-weight: 500;">curl -1sLf \ 'https://repo.kumomta.com/gpg.67E7103C/key' | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/kumomta-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/kumomta-archive-keyring.gpg] https://repo.kumomta.com/ubuntu/ $(lsb_release -cs) main" \ | -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/kumomta.list -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update && -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install kumomta
-weight: 500;">curl -1sLf \ 'https://repo.kumomta.com/gpg.67E7103C/key' | -weight: 600;">sudo gpg --dearmor -o /usr/share/keyrings/kumomta-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/kumomta-archive-keyring.gpg] https://repo.kumomta.com/ubuntu/ $(lsb_release -cs) main" \ | -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/kumomta.list -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update && -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install kumomta
v=spf1 ip4:YOUR_SERVER_IP -all
v=spf1 ip4:YOUR_SERVER_IP -all
v=spf1 ip4:YOUR_SERVER_IP -all
_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
-weight: 600;">sudo nano /etc/kumomta/kumo-mta.conf
-weight: 600;">sudo nano /etc/kumomta/kumo-mta.conf
-weight: 600;">sudo nano /etc/kumomta/kumo-mta.conf
listen 0.0.0.0:2525 { relay_hosts ["0.0.0.0/0"] smtpanner_enabled true
} dkim_sign { domain 'yourdomain.com' selector 'mail' path '/var/db/kumomta/dkim/'
} queue_run { throttle '100/second'
}
listen 0.0.0.0:2525 { relay_hosts ["0.0.0.0/0"] smtpanner_enabled true
} dkim_sign { domain 'yourdomain.com' selector 'mail' path '/var/db/kumomta/dkim/'
} queue_run { throttle '100/second'
}
listen 0.0.0.0:2525 { relay_hosts ["0.0.0.0/0"] smtpanner_enabled true
} dkim_sign { domain 'yourdomain.com' selector 'mail' path '/var/db/kumomta/dkim/'
} queue_run { throttle '100/second'
}
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable kumomta
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start kumomta # Test injection
-weight: 500;">curl -X POST http://localhost:2525/inject \ -d "[email protected]" \ -d "[email protected]" \ -d "message=From: [email protected]\\nTo: [email protected]\\nSubject: Test\\n\\nTest body"
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable kumomta
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start kumomta # Test injection
-weight: 500;">curl -X POST http://localhost:2525/inject \ -d "[email protected]" \ -d "[email protected]" \ -d "message=From: [email protected]\\nTo: [email protected]\\nSubject: Test\\n\\nTest body"
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable kumomta
-weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start kumomta # Test injection
-weight: 500;">curl -X POST http://localhost:2525/inject \ -d "[email protected]" \ -d "[email protected]" \ -d "message=From: [email protected]\\nTo: [email protected]\\nSubject: Test\\n\\nTest body" - Proper DNS records (SPF, DKIM, DMARC) take time to propagate
- IP warmup cannot be rushed
- Feedback loop setup requires ISP registration - Ubuntu 22.04 VPS with 2GB RAM minimum
- Domain name with DNS access
- Dedicated IP address (not shared)
- Port 25 open (many VPS providers block this) - Check SPF: dig +short TXT yourdomain.com
- Check DKIM: dig +short TXT mail._domainkey.yourdomain.com
- Check DMARC: dig +short TXT _dmarc.yourdomain.com
- Test with GlockApps before major campaigns - Day 1-7: 100-200 emails/day to highly engaged recipients
- Week 2: 500/day
- Week 3: 1,000/day
- Continue ramping until at target volume