SMTP Server Setup: Full Mail Infrastructure Guide

Blacksec

Administrator
Staff member
SMTP Server Setup - Full Mail Infrastructure Guide

1. SMTP Fundamentals
SMTP is the backbone of email communication. Running your own SMTP server gives control over deliverability, volume, and content - essential for email-based operations. This guide covers Postfix/Dovecot setup, SPF/DKIM/DMARC, IP warming, and reputation management.

2. Server Installation
Code:
apt-get update && apt-get install -y postfix dovecot-core dovecot-imapd opendkim opendmarc
postconf -e "myhostname = mail.yourdomain.com"
postconf -e "mydomain = yourdomain.com"
postconf -e "inet_interfaces = all"
postconf -e "smtpd_tls_cert_file = /etc/letsencrypt/live/mail.yourdomain.com/fullchain.pem"
postconf -e "smtpd_tls_key_file = /etc/letsencrypt/live/mail.yourdomain.com/privkey.pem"

# Rate limiting - essential
postconf -e "smtpd_client_connection_rate_limit = 10"
postconf -e "smtpd_client_message_rate_limit = 30"

3. Authentication
SPF: v=spf1 mx ip4:YOUR_IP ~all in DNS TXT record
DKIM: Generate key pair, publish public key in DNS, sign outgoing emails.
DMARC: _dmarc TXT v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com

4. Warmup Strategy
  • Week 1: 5-10 emails/day to known addresses.
  • Week 2: 20-50/day, increase gradually.
  • Week 3: 100-200/day, monitor bounce rates.
  • Week 4: 500-1000/day if bounce rate < 3%.
  • Week 5+: Scale to target volume while monitoring reputation.

Email deliverability is technical and reputational. Authentication alone is not enough - consistent sending and list hygiene are equally important.
 
Top