Linux-Based Email Server Deployment
Overview
Set up and configured a self-hosted email infrastructure on AlmaLinux with Exim, Dovecot, PostgreSQL, Maildir storage, DNS authentication records, TLS and Fail2ban protection.
Objectives
- Reliable self-hosted mail flow for hosted domains
- SQL-based virtual account authentication
- Strong deliverability and encrypted transport
Technologies
- AlmaLinux
- Exim
- Dovecot
- PostgreSQL
- DNS
- TLS
- Fail2ban
Architecture & Implementation
Configured Exim as the Mail Transfer Agent (MTA) and Dovecot for mailbox access; integrated PostgreSQL for email account and domain data; configured Maildir-based mailbox storage; set up DNS records including MX, SPF, DKIM and DMARC plus reverse DNS; configured Let’s Encrypt TLS certificates with renewal hooks for Exim and Dovecot; explored Fail2ban jails for SSH, Exim and Dovecot; tested incoming and outgoing email with Mozilla Thunderbird, including delivery to and replies from Gmail with SPF/DKIM/DMARC checks passing.
My Responsibilities
- MTA/MDA configuration and tuning
- PostgreSQL virtual account integration
- DNS authentication records
- TLS and client testing
Technical Challenges
- Deliverability tuning against strict remote providers
- Diagnosing deferred mail and greylisting behavior
- Securing an endlessly-scanned internet-facing service
What I Learned
Mail is the hardest easy-looking service on the internet — DNS hygiene and logs are 90% of deliverability.