A mail server is not one program but several working together. One moves messages between servers, another stores mailboxes and lets apps read them, and more filter spam and sign outgoing mail. This guide explains the mail server software you will meet – Exim, Postfix and Dovecot – and what running your own mail server involves.
Before you start
On MdmHost cPanel hosting, email is already set up and managed for you; you just create accounts in cPanel. This guide is background for understanding that setup or for planning a mail server on your own VPS.
The parts of a mail server
| Role | Common software | Protocol and ports |
|---|---|---|
| MTA – sends and receives mail between servers | Exim, Postfix | SMTP 25; submission 587 and 465 |
| MDA/IMAP server – stores mail and serves mailboxes | Dovecot | IMAP 143/993, POP3 110/995 |
| Spam and virus filtering | SpamAssassin, Rspamd, ClamAV | Internal |
| Signing and policy | OpenDKIM, Rspamd | Internal |
| Webmail | Roundcube | HTTPS |
Exim
Exim is a flexible MTA with a powerful configuration language. It is the default MTA on cPanel servers and is also used by DirectAdmin. Its routers and transports can express almost any delivery rule, which is why hosting panels like it, but its configuration is long and easy to get wrong by hand. On cPanel you manage it through WHM → Service Configuration → Exim Configuration Manager.
Postfix
Postfix was designed for security and simplicity, split into small processes with limited privileges. Its main settings live in /etc/postfix/main.cf and services in master.cf. It is the default MTA on many Linux distributions and is used by Plesk. It is the usual choice for a self-built mail server.
Exim vs Postfix
| Exim | Postfix | |
|---|---|---|
| Configuration | One large, very flexible file | Simple key = value settings |
| Security design | Monolithic process | Privilege-separated processes |
| Used by | cPanel, DirectAdmin | Plesk, many distributions |
| Best for | Panel-managed hosting | Hand-built mail servers |
Both are mature and fast. Keep whatever your control panel uses; do not swap the MTA under a panel.
Dovecot
Dovecot is the IMAP and POP3 server used by cPanel, Plesk, DirectAdmin and most self-built setups. It stores mail in Maildir format, handles authentication for mail apps and often authenticates SMTP logins for the MTA too. Its LMTP service can receive mail from Exim or Postfix and deliver it into mailboxes, applying Sieve filters.
What your own mail server needs
- A clean static IP that is not on blocklists, with outbound port 25 allowed by the provider.
- Reverse DNS (PTR) matching your mail hostname.
- DNS records: MX, SPF (TXT), DKIM (TXT) and DMARC (TXT).
- TLS certificates for SMTP, IMAP and POP3.
- Spam filtering and rate limits so a hacked account cannot send floods.
- Monitoring of the mail queue, blocklists and disk space.
Tip: Deliverability is the hard part of self-hosted mail. Unless you need full control, a managed host that already handles reputation, SPF, DKIM and spam filtering saves a lot of work.
Troubleshooting basics
- Mail stuck in queue: view with
exim -bp(Exim) orpostqueue -p(Postfix). - Can't log in with a mail app: check Dovecot logs with
journalctl -u dovecotor/var/log/maillog. - Mail goes to spam: check SPF, DKIM, DMARC and PTR records and blocklist status.
FAQ about mail server software
Which MTA does cPanel use?
Exim, together with Dovecot for IMAP/POP3.
Can Dovecot send email?
No. Dovecot only stores and serves mailboxes; sending is done by the MTA (Exim or Postfix).
Why is port 25 blocked on my VPS?
Many providers block outbound port 25 by default to prevent spam. You usually need to request it be opened.
