Email & webmail

Mail server software explained: Exim vs Postfix and Dovecot

How a mail server is built from an MTA (Exim or Postfix), an IMAP/POP3 server (Dovecot) and spam filtering, how they differ, and what you need to run your own mail server.

IntermediateMail servers3 min read

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

RoleCommon softwareProtocol and ports
MTA – sends and receives mail between serversExim, PostfixSMTP 25; submission 587 and 465
MDA/IMAP server – stores mail and serves mailboxesDovecotIMAP 143/993, POP3 110/995
Spam and virus filteringSpamAssassin, Rspamd, ClamAVInternal
Signing and policyOpenDKIM, RspamdInternal
WebmailRoundcubeHTTPS

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

EximPostfix
ConfigurationOne large, very flexible fileSimple key = value settings
Security designMonolithic processPrivilege-separated processes
Used bycPanel, DirectAdminPlesk, many distributions
Best forPanel-managed hostingHand-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

  1. A clean static IP that is not on blocklists, with outbound port 25 allowed by the provider.
  2. Reverse DNS (PTR) matching your mail hostname.
  3. DNS records: MX, SPF (TXT), DKIM (TXT) and DMARC (TXT).
  4. TLS certificates for SMTP, IMAP and POP3.
  5. Spam filtering and rate limits so a hacked account cannot send floods.
  6. 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) or postqueue -p (Postfix).
  • Can't log in with a mail app: check Dovecot logs with journalctl -u dovecot or /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.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.