New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
SMTP and APIUpdated 4 Nov 2026

MTA, MDA and MUA explained: the parts of an email system and what each does

A clear explanation of the mail user agent (MUA), mail submission agent (MSA), mail transfer agent (MTA) and mail delivery agent (MDA), how a message passes through them and where each fits when you troubleshoot.

TK
Written by Tomasz Kowalski
Infrastructure and Reliability Engineer
Reviewed by Ishita Rao
  • Published9 Aug 2023
  • Read time6 min
  • Length1,296 words
Share this guide

An email system is split into specialised programs. The mail user agent (MUA) is the application a person uses to read and write mail. The mail submission agent (MSA) accepts a new message from the MUA after authenticating the sender. The mail transfer agent (MTA) moves messages between servers over SMTP. The mail delivery agent (MDA) takes the final message and places it into the recipient's mailbox. Retrieval by the user then happens through IMAP or POP3, usually provided by an access server alongside the MDA.

In small installations one product can play several roles, which is why the terms confuse people. Knowing which role is failing is the fastest way to troubleshoot: a login problem points at the MSA, a routing or reputation problem at the MTA, a mailbox or quota problem at the MDA, and a display problem at the MUA.

MUAThe client: Thunderbird, Outlook, Apple Mail, a webmail interface or your application code
MSA / MTAAccept and relay mail over SMTP. The MSA handles authenticated submission, the MTA routes between domains
MDAStores the final message in the recipient mailbox, applying filters and quotas
RetrievalIMAP or POP3 lets the MUA read the stored mailbox

The journey of a message

  1. Compose. The sender writes a message in an MUA.
  2. Submit. The MUA connects to the sender's mail server, usually on port 587 with STARTTLS, or 465 with implicit TLS, and authenticates. The server role that accepts it is the MSA.
  3. Route. The sending MTA looks up the MX records for the recipient domain and connects to the best-priority server, typically on port 25.
  4. Accept. The receiving MTA checks the connection, authentication results and policies, then accepts or rejects the message.
  5. Deliver. The receiving MTA hands the message to the MDA, which writes it to the user's mailbox after any filtering.
  6. Read. The recipient's MUA fetches the message over IMAP or POP3, or the webmail interface reads it directly.

For a high-level view see how email works. Each hop adds a Received header, so the path can be reconstructed afterwards. See Received headers.

MUA: mail user agent

The MUA is the part people see. It composes messages, displays them, manages folders and contacts and speaks two kinds of protocol: SMTP to send, IMAP or POP3 to read. Examples are desktop clients, mobile mail apps and browser-based webmail. A script that sends mail through a library is also an MUA from the server's point of view, because it submits a message. The MUA does not deliver mail to other domains by itself. It hands the message to a server.

MSA: mail submission agent

RFC 6409 defines message submission as a separate service from relay between servers. The MSA listens on port 587 (and servers commonly offer 465 with implicit TLS), requires authentication and may correct or complete a message, for example by adding a missing Date or Message-ID header. Splitting submission from relay lets operators require login for users while accepting unauthenticated mail from other servers on port 25. In many products the MSA and MTA are the same program listening on different ports. See SMTP submission.

MTA: mail transfer agent

The MTA is the postal sorting and transport layer. It accepts messages, decides where to send them, queues them, retries on temporary failure and generates bounces when delivery fails permanently. Well-known MTAs include Postfix, Exim, Sendmail and KumoMTA. An MTA is both a server, when it receives mail, and a client, when it forwards it. The queue, retry schedule and bounce handling are what make email reliable even when remote servers are unavailable. See what an MTA is and a comparison of common MTAs.

MDA: mail delivery agent

The MDA is the last step on the receiving side. It takes a message from the MTA and writes it to storage: a Maildir directory, an mbox file or a database. On the way it can apply user rules, run spam and virus filtering, enforce quotas and move the message to the right folder. Examples include Dovecot's local delivery agent and LMTP service, procmail and maildrop. Between the MTA and MDA, many systems use LMTP (RFC 2033), a variation of SMTP made for final delivery, which allows a status per recipient. When a mailbox is full, the failure arises here and shows up as a bounce.

Access servers: IMAP and POP3

A fifth role is the server that lets clients read stored mail. IMAP keeps messages on the server and synchronises state across devices. POP3 typically downloads and may remove messages from the server. Dovecot is a common implementation that provides both IMAP and the delivery side. See IMAP, POP3 and SMTP compared.

Summary table

RoleFull nameMain protocolTypical portsExamplesProblems here look like
MUAMail user agentSMTP out, IMAP or POP3 inClient sideThunderbird, Outlook, Apple Mail, webmail, app codeWrong settings, display issues, cannot connect
MSAMail submission agentSMTP submission587, 465Postfix submission service, provider relay535 authentication failed, 530 STARTTLS required
MTAMail transfer agentSMTP25 between serversPostfix, Exim, Sendmail, KumoMTADeferrals, blocklists, 550 rejections, routing failures
MDAMail delivery agentLMTP or local deliveryLocal socketDovecot, procmail, maildropMailbox full, filtering mistakes, permission errors
Access serverIMAP or POP3 serverIMAP, POP3993, 143, 995, 110Dovecot, CyrusCannot read or sync mail

A simple server layout

A typical self-hosted setup has Postfix as MSA and MTA, Dovecot as MDA and IMAP server, and rules that pass mail from one to the other. The Postfix line below hands final delivery to Dovecot over LMTP. Paths depend on your distribution and configuration, so treat it as an illustration.

# /etc/postfix/main.cf  (illustrative)
virtual_transport = lmtp:unix:private/dovecot-lmtp
smtpd_tls_security_level = may

# /etc/postfix/master.cf  (submission service for authenticated users)
submission inet n - y - - smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject

Seeing the roles in practice

You can observe the MTA and MSA directly with a few commands. The first finds where mail for a domain should go. The second opens a STARTTLS session to a submission service and shows its greeting and capabilities.

dig +short MX example.com
openssl s_client -starttls smtp -connect smtp.migosmtp.com:587 -crlf
# After the banner, type:  EHLO test.example.com

The EHLO response lists the extensions offered, such as AUTH mechanisms after TLS has started. A longer walkthrough is in testing an SMTP server.

Where hosted services fit

Most people do not run all these components. A mailbox provider gives you an MUA (webmail), an MSA, an MTA, an MDA and an access server as one service. An SMTP relay or email API provider runs the MSA and MTA parts for you: your application acts as the MUA, authenticates to the submission service and the provider's MTA routes the mail, retries it and reports bounces. You still receive replies at a mailbox provider's MDA. Understanding the split helps you choose the right service, since sending infrastructure and mailbox hosting are different jobs.

Troubleshooting by role

SymptomRole to checkFirst step
Cannot log in to sendMSACheck username, password, port and TLS mode
Sent but never arrives, no bounceSending MTALook at the queue and the logs for deferrals
Immediate 550 or 554 rejectionReceiving MTARead the response text for the reason, then the policy it cites
Bounce says mailbox fullMDAAsk the recipient to free space or raise the quota
Message arrives but is in the wrong folderMDA filtersReview server rules and filters
Message delivered but not visible in the clientMUA or access serverCheck IMAP sync, folder subscriptions and client filters

Four small programs and two retrieval protocols make up the email system most people use daily. Knowing which one is responsible makes logs and error messages far easier to read, and tells you whether a problem belongs to you, your provider or the recipient.

Hand off the sending roles Use the SMTP relay as your submission and transfer service and keep your application as the MUA.

Explore the SMTP relay

References and further reading

Frequently asked questions

What is the difference between an MTA and an MDA?

An MTA routes and transfers messages between servers over SMTP. An MDA takes the final message and stores it in the recipient mailbox.

What is an MUA?

The mail user agent is the client application that composes, sends and displays mail, such as Thunderbird, Outlook or webmail.

What is an MSA?

The mail submission agent accepts mail from authenticated users, usually on port 587 or 465, and passes it on to the MTA.

Is Postfix an MTA or an MDA?

Postfix is an MTA. It hands final delivery to an MDA such as Dovecot over LMTP or to local delivery.

Where do IMAP and POP3 fit?

They are retrieval protocols used by the MUA to read mail from the stored mailbox, not to send or route it.

Topics#mta#mda#mua#msa#architecture#smtp#imap
Was this guide helpful?Your answer helps us improve our documentation.

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales