Blog/ Email glossary & concepts

MTA vs MDA vs MUA vs MSA: Email's Four Agent Roles Explained

Nafiul HasanNafiul Hasan· 11 min read
Diagram of email's four agent roles, MUA, MSA, MTA and MDA, showing a message moving from the sender's mail client through the submission agent and transfer agents to a delivery agent that files it into the recipient's mailbox.

The short answer

An MUA is the email app you read and write in. The MSA accepts the message you send, MTAs relay it between servers, and the MDA files it into the recipient's mailbox. Four roles from RFC 5598 handle one message: submission, transfer and delivery happen on servers, while the MUA only starts and ends the trip.

The MUA vs MTA vs MDA difference, plus the MSA: what each of email's four RFC 5598 roles does and how a message moves from your client to a mailbox.

On this page
  1. 01The four roles, in one line each
  2. 02MUA vs MTA vs MDA vs MSA at a glance
  3. 03How an email moves from your client to a mailbox
  4. 04The MUA: the program you actually read mail in
  5. 05The MSA: what accepts your outbound message
  6. 06The MTA: the relay between mail servers
  7. 07The MDA: what files it into the mailbox
  8. 08MTA vs MDA: the difference
  9. 09Which of these do you actually choose?
  10. 10Where AI Emaily fits in this picture
  11. 11Which role failed when mail breaks

The four roles, in one line each#

The MUA vs MTA vs MDA vs MSA difference comes down to one thing: these are not rival products. They are four jobs in the relay that carries an email from your keyboard to someone else's inbox, and each role is responsible for one leg of the trip.

  • MUA (email client), or Message User Agent: the program you read and write mail in. It composes your message and hands it off, and it displays mail that arrives for you.
  • MSA (Mail Submission Agent): the first server that accepts your outbound message, checks who you are, and enforces your provider's rules before the message enters the transfer network.
  • MTA (Message Transfer Agent): a relay that moves the message server to server, one hop at a time, toward the recipient's domain.
  • MDA (Mail Delivery Agent): the final hand-off that files the message into the recipient's mailbox, where their own MUA can fetch it.

MUA vs MTA vs MDA vs MSA at a glance#

RFC 5598, titled 'Internet Mail Architecture', is where the names and boundaries come from. The table pairs each role with its RFC section and with software you may already recognise. One quirk: the RFC's section headings say 'Message' for the MUA and MTA but 'Mail' for the MSA and MDA.

RoleRFC 5598 name (section)What it doesReal-world exampleSpeaks
MUAMessage User Agent (4.2.1)The app you read and write mail in; composes and submits, and shows received mailApple Mail, Outlook, Thunderbird, Gmail's web interface, AI-native clients like AI EmailyIMAP, POP or a provider API to read; hands outbound mail to the provider
MSAMail Submission Agent (4.3.1)Accepts your outbound message, authenticates you, and enforces your provider's policyYour provider's outgoing server, e.g. smtp.gmail.com on the submission portSMTP submission, usually port 587 (RFC 6409) or 465 (RFC 8314)
MTAMessage Transfer Agent (4.3.2)Relays the message server to server, one hop at a time, toward its destinationPostfix, Exim, Sendmail, Microsoft Exchange transportSMTP relay, port 25 (RFC 5321)
MDAMail Delivery Agent (4.3.3)Takes the final hand-off and writes the message into the recipient's mailboxDovecot's LMTP/LDA, procmail, maildrop, a mail server's local deliveryLMTP or a local delivery transport

How an email moves from your client to a mailbox#

Here is the same journey as a sequence. Each step is one hand-off, and each server takes responsibility for the message before the previous one lets go. This is how MTAs store and forward, the model email has used since the start.

  1. 1

    You hit Send in your MUA

    Your mail client, the Message User Agent, finishes the message and connects to your provider's submission service. In RFC 5598 terms this is the author MUA, or aMUA.

  2. 2

    The MSA accepts and checks it

    The Mail Submission Agent authenticates you, may add or repair headers, and enforces your provider's policy. Only after it accepts responsibility does the message enter the transfer network.

  3. 3

    MTAs relay it hop by hop

    One or more Message Transfer Agents look up the recipient domain's MX record in DNS, open an SMTP connection to the next server, and pass the message along until it reaches the receiving side.

  4. 4

    The MDA files it into the mailbox

    The final MTA hands off to the Mail Delivery Agent, which writes the message into the recipient's mailbox (the Message Store, RFC 5598 section 4.2.2), applying any delivery-time filtering along the way.

  5. 5

    The recipient's MUA fetches it

    The recipient opens their own client, the recipient MUA (rMUA). It retrieves the message from the store and displays it. The relay is done.

A left-to-right routing diagram: a message leaves the sender's MUA, is accepted by the MSA, relayed across two MTAs, handed to the MDA, written into the mailbox store, and finally fetched by the recipient's MUA.
One message, five hand-offs. Each role owns exactly one leg of the trip and passes responsibility to the next.

The MUA: the program you actually read mail in#

The Message User Agent is the only one of the four you normally see. It is your email client: Apple Mail, Outlook, Thunderbird, Gmail's web interface, a phone mail app, or an AI-native client. RFC 5598 section 4.2.1 says the MUA 'works on behalf of User Actors and User applications'. In plain terms, it acts for you.

The standard splits the role in two by direction. The author MUA (aMUA) is the sending side: it composes your message and submits it. The recipient MUA (rMUA) is the reading side: it pulls delivered mail from the store and shows it to you. The same app usually plays both parts.

A key boundary: the MUA does not relay mail across the internet. It hands outbound messages to a submission service and reads incoming ones from a mailbox store. Everything between those two points belongs to the agents below, which is why a client can look broken when the real fault is a server you never see.

The MSA: what accepts your outbound message#

MSA stands for Mail Submission Agent, so 'MSA mail' simply means mail handed to your provider's submission server. RFC 5598 section 4.3.1 says it 'accepts the message submitted by the aMUA and enforces the policies of the hosting' provider. It is the doorway between your client and the transfer network, and the piece most short summaries drop.

Submission is deliberately kept separate from relay. Your client authenticates to the MSA, so the provider knows the message is really yours before it accepts responsibility. The MSA can also tidy the message: RFC 6409 lets it add a missing Date or Message-ID header, and rewrite addresses according to local policy.

The ports used by the MSA are 587, normally upgraded with STARTTLS, and 465, which uses implicit TLS from the first byte.

Submission and relay use different ports

RFC 6409, 'Message Submission for Mail', reserves port 587 for submission from a client to its MSA, and RFC 8314 assigns port 465 to submission over implicit TLS. Server-to-server relay between MTAs uses port 25. If outbound mail is failing, the port you are using tells you which role you are talking to.

The MTA: the relay between mail servers#

A Message Transfer Agent is the mail server software that moves email between servers on its way to the recipient's domain. RFC 5598 section 4.3.2 says an MTA 'relays mail for one application-level hop': it accepts a message, works out where the next server is, and passes it on. A message often crosses several MTAs before it arrives.

MTAs speak SMTP, the Simple Mail Transfer Protocol defined in RFC 5321. That standard says a relay transmits mail 'without modification to the message data other than adding trace information', which is why each hop stamps a Received header but leaves your words alone.

Is Postfix an MTA or an MDA? Postfix is an MTA, and so are Exim, Sendmail and Microsoft Exchange's transport service. On a small server a single package can wear more than one hat: Postfix can also listen as an MSA for submission and ships a local delivery component. But its core job is transfer, and busy setups usually hand final delivery to a dedicated MDA.

The MDA: what files it into the mailbox#

The Mail Delivery Agent handles the last step. RFC 5598 section 4.3.3 frames it as a change of custody: 'a transfer of responsibility from the' transfer network 'to a Recipient's environment (mailbox) is called delivery'. The MDA is the software that performs that write.

Delivery is where per-recipient rules run. The MDA can sort into folders, apply Sieve filters, forward, or reject before the message lands. Common delivery agents include Dovecot's LMTP and LDA, procmail and maildrop; on some servers the MTA's own local transport does the job.

After delivery the message sits in the Message Store (RFC 5598 section 4.2.2), the mailbox the recipient's MUA reads from. The MDA writes; the recipient's client reads. That split is why one server can relay mail while a different one holds and serves the mailboxes, even inside the same provider.

MTA vs MDA: the difference#

An MTA moves a message between servers; an MDA puts it in a specific person's mailbox. The MTA's question is where the next hop is, and the MDA's question is which mailbox and folder this belongs in. Once the MDA has written the message, the transfer network's job is over.

Bounces usually come from the MTA side, because a server could not pass the message on. Mail that was accepted but never appears points at the MDA side, such as a filter or a full mailbox. Postfix with Dovecot is the classic pairing: Postfix transfers and Dovecot delivers.

Which of these do you actually choose?#

For almost everyone, the answer is short: only the MUA. Sign up with Gmail, Microsoft 365, Fastmail or a hosting provider, and that provider runs the MSA, the MTAs, the MDA and the Message Store for you. You never configure them by name, and you rarely pay for them as separate items.

If you self-host, you assemble the roles yourself, typically with open-source software: Postfix or Exim for transfer, Dovecot for delivery and the store. Either way, the piece you pick and switch is the client, which is why email clients are where products genuinely compete.

Where AI Emaily fits in this picture#

We build AI Emaily, so this is the disclosure and the placement in one place. In RFC 5598 terms, AI Emaily is an MUA. It is the app you read and write mail in, not a mail server, and it does not touch your MX records.

Your provider keeps running submission, transfer and delivery. For IMAP and SMTP accounts, AI Emaily hands outbound mail to the provider's MSA over SMTP. For Gmail and Microsoft 365 it uses the provider's API (the Gmail API and Microsoft Graph) instead, so the message reaches the provider's submission endpoint without a client SMTP session.

What it adds on top of the plain MUA role is one inbox across those accounts and an AI agent that triages and drafts. In Copilot mode you approve every send; Autopilot handles routine mail within your rules, with undo and a readable audit log. Drafts come from a Personal Context you set plus per-client profiles.

If your problem is a mail server, such as self-hosting an MTA, debugging delivery at the MDA, or tuning deliverability, that is infrastructure work AI Emaily does not do. The connect-mailbox guide covers linking an account.

Which role failed when mail breaks#

The four-role model earns its keep when something does not arrive. The symptom usually points at one agent, which tells you where to look instead of blaming the whole system.

SymptomLikely roleWhy
Your client rejects the password when sendingMSAAuthentication failed at the submission server, so the message never entered the transfer network
The message left but bounced back laterMTAA transfer agent along the route could not relay to the next hop and returned the mail
The recipient's server accepted it but the inbox is emptyMDADelivery-time filtering, a Sieve rule, or a full mailbox filed or dropped it during the final write
You can send but no new mail appears in the appMUA / storeYour client's fetch from the Message Store is failing, so the transfer path is fine

Frequently asked

Nafiul Hasan

Written by

Nafiul Hasan

Nafiul Hasan is an entrepreneur and AI automation system builder with 10+ years of experience turning messy, manual workflows into reliable automated systems. He designs and ships AI enterprise solutions end-to-end — the agent logic, the data plumbing, and the product people actually use — and founded AI Emaily to give busy professionals their attention back. He writes here from the builder's seat: what works, what breaks, and how to put AI to work without giving up control.

EntrepreneurAI Automation System BuilderAI EnthusiastBuilds AI Enterprise Solutions10+ years experience
More from Nafiul
Ready when you are

Want an AI-native MUA for Gmail, Outlook and IMAP?

AI Emaily is a mail client, a Message User Agent with an AI agent that triages and drafts. In Copilot mode you approve every send, with undo and a readable audit log. We build AI Emaily.

  • 7-day free trial
  • Cancel anytime
  • Every provider