Webiano Digital & Marketing Agency
Webiano Digital & Marketing Agency
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Menu
  • Home
  • About Us
  • Services
    • Strategy
    • Digital Platforms
    • Performance
    • Communication
    • Infrastructure
    • Consulting
    • Education
    • All Services
  • Clients
  • Insights
    • Agency Journal
    • AI Search & Discoverability
    • Artificial Intelligence
    • Brand Positioning & Authority
    • Digital Platforms
    • Infrastructure & Security
    • Performance & Digital Marketing
    • Linux & Open Source
    • Visual Content & Production
    • Digital Work & Society
    • Web Radar
    • Robotics & Embodied AI
    • All Insights
  • FAQ
  • Knowledge base
  • Contact
Home » Knowledge base » Internet » Email infrastructure » Exim

Exim

5 min read · 7 sections

In short

Exim is an open-source mail transfer agent for Unix-like systems that routes, delivers and filters email over SMTP using a highly flexible configuration file.

On this page 7
  1. How Exim processes a message
  2. Routers, transports and string expansion
  3. Exim compared with other mail transfer agents
  4. Security and anti-spam features
  5. Operating and troubleshooting Exim
  6. A non-technical view
  7. A concrete example

Exim is a free, open-source mail transfer agent (MTA) for Unix-like operating systems that receives messages over SMTP, decides where each one should go and delivers it locally or to remote servers. In email infrastructure, it occupies the same role as Postfix or Sendmail and is one of the most widely deployed MTAs on the public Internet.

Exim was created at the University of Cambridge and is distributed under the GNU General Public License. It is the default MTA on Debian and on many shared hosting control panels such as cPanel, which explains its large footprint. Its defining trait is a single, highly programmable configuration file that lets administrators express almost any routing or filtering policy.

How Exim processes a message

Exim handles every message in three stages: reception, routing and transport. During reception, the SMTP listener or a local command such as sendmail accepts the message, runs access control lists and writes it to the spool directory as a header file and a data file.

A queue runner then picks up each spooled message and passes every recipient address through an ordered list of routers. The first router that accepts an address decides how it will be delivered and assigns a transport, which performs the actual delivery, for example over SMTP to another server or into a local mailbox.

The table below lists the main building blocks an administrator configures in Exim.

ComponentRoleTypical example
Main sectionGlobal options for the daemonHostname, listening ports, TLS certificate
ACLsAccept, defer or deny during the SMTP dialogueReject unknown recipients at RCPT time
RoutersDecide how each address is handleddnslookup for remote domains
TransportsCarry out the deliveryremote_smtp, appendfile for Maildir
Retry rulesControl redelivery after temporary failureRetry every 15 minutes for 4 days
Rewrite rulesChange addresses in headers or envelopeMap internal names to public domains
Core components of an Exim configuration

Temporary failures leave a message on the queue, and retry rules decide when Exim tries again. When the retry limit expires, Exim generates a bounce message to the sender explaining the permanent failure.

Routers, transports and string expansion

The flexibility of Exim comes from its string expansion language, which lets almost any configuration option be computed at run time. Expansions such as ${lookup} query flat files, DBM databases, LDAP, MySQL, PostgreSQL or DNS, so routing tables can live in external data sources.

Routers are evaluated strictly in order, and conditions such as domains, local_parts and condition decide whether each router applies. This ordered model makes complex policies possible, but it also means a misplaced router can silently capture addresses intended for another rule.

Router driverWhat it doesCommon use
dnslookupLooks up MX records for a domainDelivery to remote Internet domains
manualrouteSends mail to listed hostsSmart host or SMTP relay setup
redirectExpands aliases and forward filesAlias tables, .forward, Sieve-style filters
acceptAccepts the address unconditionallyFinal local delivery to mailboxes
queryprogramAsks an external program for routingCustom integration with other systems
Frequently used Exim router drivers

Exim compared with other mail transfer agents

Exim differs from its main competitors in architecture and configuration style rather than in protocol support, since all mainstream MTAs implement SMTP, TLS and modern authentication checks. The choice usually depends on the operating system default, the hosting panel and the administrator’s experience.

PropertyEximPostfixSendmail
ArchitectureMostly monolithic binaryMultiple cooperating processesMonolithic binary
ConfigurationOne expandable filemain.cf and master.cfm4 macros compiled to sendmail.cf
FlexibilityVery highHigh with lookup tablesHigh but complex
Security recordSeveral serious CVEsStrong recordWeak historically
Typical homeDebian, cPanel hostingMany Linux distributions, macOSLegacy Unix systems
Exim, Postfix and Sendmail compared

Exim handles only message transfer. Mailbox access through IMAP or POP3 is left to a separate server such as Dovecot, which also commonly provides SMTP authentication to Exim.

Security and anti-spam features

Exim enforces most mail policy through access control lists that run at each SMTP stage, such as connect, HELO, MAIL, RCPT and DATA. Rejecting spam during the SMTP dialogue is preferable to accepting and bouncing it later, because it avoids backscatter to forged senders.

  • DNSBL checks with the dnslists condition block known spam sources at connection or recipient time.
  • Built-in DKIM signing and verification, plus SPF and DMARC support when compiled with the relevant libraries.
  • STARTTLS for encrypted server-to-server transport and authenticated submission on port 587.
  • Content scanning hooks for SpamAssassin and ClamAV through the spam and malware ACL conditions.
  • Rate limiting with ratelimit to stop compromised accounts from sending floods.

Because Exim is widely exposed, it is a frequent attacker target. Critical remote code execution flaws were disclosed in 2019 and again in later years, and attackers exploited unpatched servers at scale. Prompt patching and running supported versions are therefore essential.

Operating and troubleshooting Exim

Exim ships with command-line tools that make queue inspection and debugging straightforward. Administrators who know them can diagnose most delivery problems without reading raw spool files.

CommandPurpose
exim -bpList messages on the queue
exim -bt addressTest how an address would be routed
exim -bh IPSimulate an SMTP session from an IP address
exim -qffForce a delivery run of the whole queue
exiwhatShow what running Exim processes are doing
exigrepSearch logs and group lines per message
Everyday Exim administration commands

Common mistakes include running an open relay through overly broad relay_from_hosts settings, missing reverse DNS for the sending IP and letting the queue grow unchecked after a spam outbreak. A growing frozen queue is often the first visible sign of a compromised account.

A non-technical view

Exim is a digital post office sorter. When an email arrives, Exim reads the address, decides whether the message stays in this building or travels to another post office and then sends it on its way.

What makes Exim special is how precisely its rulebook can be written. Administrators can describe almost any sorting rule, which is powerful but demands care, because one wrong rule can send mail to the wrong place.

A concrete example

A web hosting company runs several hundred customer domains on Linux servers managed through a control panel that installs Exim by default. Each server receives inbound mail for its domains and sends outgoing mail generated by customer websites and mail clients.

The administrators configure ACLs that check two DNS blocklists at RCPT time, verify DKIM on incoming mail and sign outgoing mail with per-domain DKIM keys. A ratelimit rule caps each authenticated user at 200 messages per hour, and messages above the limit are deferred rather than accepted.

When a customer’s password is stolen, the rate limit stops the attacker after the first few hundred messages, and exim -bp immediately shows the deferred backlog. The team removes the queued spam, resets the password and avoids having the server IP listed on a blocklist, so legitimate customer mail keeps flowing without interruption.

Published November 27, 2026

Filed under

  • Internet

    Subject

  • Email infrastructure

    Topic

Growth is engineered, not improvised.

All rights reserved © 2002–2026 | Webiano Digital & Marketing Agency

Social Media

  • Facebook
  • LinkedIn
  • YouTube

GDPR, Privacy and Cookies Policy

Copyright and Content Use Policy

Webiano Code of Ethics

  • Slovakia
  • Czechia
  • Europe
  • Global

Daily News & Insights via RSS