A mail transfer agent (MTA) is the server software that moves email from one machine to another using SMTP. It accepts a message, stores it in a queue, looks up where the recipient's domain receives mail, connects to that server, hands the message over and retries if the remote side is unavailable. If delivery fails permanently, it generates a bounce. Postfix, Exim, Sendmail and KumoMTA are four well-known examples.
They solve the same core problem but with different priorities. Postfix emphasises security and simple configuration, Exim emphasises flexibility, Sendmail is the historic original and KumoMTA is a newer, scriptable engine aimed at high-volume sending. Choosing between them depends on whether you are running a general mail server, a relay for applications or a bulk sending platform.
What an MTA does, step by step
- Accepts a message from a client or another server over SMTP, applying authentication and policy checks.
- Queues it on disk so that it survives restarts and temporary failures. See the mail queue.
- Routes it by looking up the MX records of the recipient domain, or by applying a rule such as sending everything to a smarthost.
- Connects to the destination, negotiates TLS if offered and transfers the message.
- Handles the response. A 2xx reply completes delivery, a 4xx reply schedules a retry and a 5xx reply produces a bounce. See retry schedules.
- Hands over locally to a mail delivery agent when the recipient is on the same system.
- Logs every step so that you can trace what happened.
An MTA is not a mail client and not a mailbox store. The roles are described in MTA, MDA and MUA explained, and the concept is covered in what an MTA is and how it works.
The four MTAs compared
| Aspect | Postfix | Exim | Sendmail | KumoMTA |
|---|---|---|---|---|
| Origin and character | Written as a secure, modular alternative to Sendmail | Developed at the University of Cambridge, very flexible | One of the earliest MTAs, dating from the 1980s | Newer open-source MTA written in Rust, aimed at high-volume senders |
| Design | Several cooperating processes with small responsibilities | One main program with powerful routers and transports | Large monolithic daemon | Asynchronous engine with queues per destination and policy scripts |
| Configuration | Plain text files such as main.cf and master.cf | One configuration file with a rich string expansion language | Macro files compiled to sendmail.cf | Lua scripts and structured configuration |
| Strength | Predictable, well documented, common choice for relays | Complex routing and per-message logic | Ubiquity on older systems, long track record | Throughput, traffic shaping and programmable policy |
| Typical use | General mail servers, relays and smarthosts | Hosting providers and sites needing custom routing | Legacy systems and environments that already depend on it | Bulk and transactional sending platforms |
| Learning curve | Moderate | Steeper because of its expansion language | Steep, config is hard to read | Needs scripting skills and operational care |
Treat the table as a summary of design intent. Details change between versions, so confirm features in each project's current documentation. Defaults also differ between Linux distributions, and several distributions ship one of these MTAs as the default.
Postfix
Postfix is a popular choice for mail servers and application relays. Its structure splits work among small processes, which limits the damage from a flaw in any one component, and its configuration is easy to read. A common role is a relay that forwards all mail through a smarthost with authentication, as described in configuring Postfix as an SMTP relay. Useful commands for inspection are shown below.
postconf -n # show non-default configuration
postfix check # check configuration and permissions
postqueue -p # list the queue
postqueue -f # flush the queue
tail -f /var/log/mail.log # path varies by distributionExim
Exim is known for flexible routing. Its routers and transports let administrators decide on a per-message basis how to deliver, and its string expansion language can make decisions based on almost any property of the message. That power suits hosting platforms with complex requirements, but it also makes configuration harder to read and audit. Many distributions, including Debian historically, have packaged Exim as a default; check your system. Inspection commands include the following.
exim -bp # list the queue
exim -bt [email protected] # test how an address would be routed
exim -Mvl <message-id> # view the log for a message
exim -qff # attempt delivery of everything, including frozenSendmail
Sendmail is the historic MTA that much of the internet used for decades. It is still found on older systems and some commercial Unix environments, and its command line interface (sendmail -t) survives as a compatibility interface in other MTAs, so scripts written for it still work. Its configuration is built with m4 macros that produce a dense file, which many administrators find difficult. New deployments generally choose Postfix, Exim or another modern MTA, but you may need to maintain Sendmail where it already runs.
mailq # show the queue
sendmail -bp # same, on most installations
echo "Test" | sendmail -v [email protected]KumoMTA
KumoMTA is an open-source MTA designed for senders who deliver large volumes and need fine control. Rather than a static configuration file, it uses Lua scripts for policy, so traffic shaping, routing, DKIM signing and queue behaviour per destination can be written as code. It offers an HTTP API for injection and events and is built to manage per-provider rate limits and retries. The sample below is only an illustration of the shape of an init script; consult the project documentation for the current API before using any of it.
-- init.lua (illustrative only)
local kumo = require 'kumo'
kumo.on('init', function()
kumo.start_esmtp_listener {
listen = '0.0.0.0:25',
relay_hosts = { '127.0.0.1' },
}
kumo.define_spool { name = 'data', path = '/var/spool/kumomta/data' }
kumo.define_spool { name = 'meta', path = '/var/spool/kumomta/meta' }
kumo.configure_local_logs { log_dir = '/var/log/kumomta' }
end)Running a high-volume MTA is more than installing software. You also need IP reputation management, warm-up, authentication, bounce processing, feedback loop handling and monitoring. See build versus buy for email infrastructure before committing to run your own.
How to choose
| Need | Reasonable starting point |
|---|---|
| Send system mail from a server | A minimal Postfix or Exim set up as a null client that forwards to a smarthost |
| Run mail for a company or hosting platform | Postfix or Exim with a separate delivery agent and access server |
| Maintain an existing legacy system | Sendmail, and plan a migration when practical |
| Run a high-volume sending platform | KumoMTA or another engine built for outbound scale, plus deliverability operations |
| Send application mail without operating servers | Use an SMTP relay or API service instead of an MTA of your own |
Security basics for any MTA
- Never run an open relay. Restrict relaying to authenticated users and trusted networks. See open relays.
- Enable TLS for inbound and outbound connections, with valid certificates.
- Authenticate the domain: publish SPF, DKIM and DMARC and set a matching reverse DNS record.
- Keep software updated and restrict who can administer the host.
- Monitor the queue and logs and alert on growth or unusual traffic.
- Rate limit outbound mail per user and per destination so that one compromised account cannot burn your reputation.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Queue grows steadily | Remote deferrals, DNS failure or blocked outbound port 25 | Read the deferral text in the logs and test connectivity |
| Relay access denied | Client not authenticated or not in the trusted list | Fix authentication or relay rules, not by opening relay for all |
| Mail rejected at the receiver | Missing reverse DNS, SPF or DKIM, or blocklisted IP | Check authentication and listings |
| Messages stuck as frozen (Exim) | Delivery failed in a way that needs attention | Inspect the message log and thaw or remove as appropriate |
| TLS errors on connection | Certificate or protocol mismatch | Verify certificate chain, names and supported protocol versions |
An MTA is the engine at the centre of email delivery. Postfix and Exim cover most general needs, Sendmail remains where it was installed long ago and KumoMTA addresses high-volume outbound sending. If you only need to send application mail, a managed relay removes the operational burden while leaving you in control of your messages.
Send without running your own MTA Use a managed SMTP relay with authentication, TLS and event webhooks.
References and further reading
Frequently asked questions
What is an MTA?
A mail transfer agent is software that accepts email, queues it, routes it to the recipient server over SMTP, retries on temporary failure and generates bounces.
Which MTA should I choose?
Postfix or Exim suit most general needs, Sendmail is mainly for existing systems and KumoMTA targets high-volume outbound sending.
Is Sendmail still used?
Yes, mostly on older systems. Its command line interface is also kept for compatibility by other MTAs.
What makes KumoMTA different?
It is built for high-volume outbound mail and uses Lua scripts for policy such as routing, traffic shaping and signing.
Do I need my own MTA to send application email?
No. A managed SMTP relay or email API handles queuing, retries and bounces, so you only submit messages.