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 » Mail delivery agent

Mail delivery agent

6 min read · 7 sections

Also known as: MDA

In short

A mail delivery agent (MDA) is the email server component that files accepted messages into the correct local mailbox, applying filters and quotas on the way.

On this page 7
  1. How a mail delivery agent completes the delivery chain
  2. Common MDA implementations and mailbox formats
  3. How the MDA differs from the MTA and MSA
  4. Configuring filtering, quotas and error handling
  5. Failure modes and common configuration mistakes
  6. The short version
  7. Where it makes a difference

A mail delivery agent (MDA) is the software component that takes a message already accepted by a mail server and writes it into the recipient’s mailbox on local storage. In email infrastructure on the Internet, the MDA is the last hop of the server-side chain: the mail transfer agent moves messages between hosts, and the MDA performs final local delivery, often applying filtering, sorting and quota rules before the message becomes visible to the user.

The MDA rarely appears in user-facing discussions, yet it decides where a message is stored, in which format and under which rules. Problems in this stage explain many cases in which a message was accepted by the server but never reached the expected folder.

How a mail delivery agent completes the delivery chain

A mail delivery agent receives a message from the mail transfer agent (MTA) after the MTA has decided that the recipient is local. The MTA hands over the message through a local pipe, LMTP or a direct program call, together with the envelope recipient. The MDA then resolves the target mailbox, runs any user or system filters, and stores the message.

The handoff interface determines how errors propagate. With a pipe, the MDA reports success or failure through exit codes, and the MTA interprets a temporary code as a reason to retry. With the Local Mail Transfer Protocol (LMTP), defined in RFC 2033, the MDA returns a separate status for each recipient, which avoids duplicate deliveries when one of several recipients fails.

The table below shows the stages that a typical delivery passes through after SMTP acceptance.

StageComponentResult
Recipient lookupMTAMessage marked as local
HandoffMTA to MDA via pipe or LMTPEnvelope and body transferred
Mailbox resolutionMDAUser and storage path identified
FilteringMDA with Sieve or procmail rulesTarget folder chosen or message discarded
StorageMDAMessage written to Maildir or mbox
Indexing and notificationMDA or IMAP serverClient sees the new message
Stages of local delivery after SMTP acceptance

Common MDA implementations and mailbox formats

Several programs serve as mail delivery agents, and they differ mainly in filtering language, protocol support and integration with the mailbox server. Modern deployments favor an MDA that is part of the IMAP server, because shared indexes and quota accounting stay consistent.

MDAInterfaceFilteringTypical deployment
Dovecot LDA and LMTPPipe or LMTPSievePostfix or Exim with Dovecot IMAP
procmailPipeprocmail recipesLegacy Unix servers
maildropPipemaildrop languageCourier-based systems
Cyrus deliver and LMTPLMTPSieveCyrus IMAP clusters
Exim local transportsInternalExim filtersSingle-host Exim servers
Widely used mail delivery agents

The storage format is equally important. Maildir stores one file per message, which makes concurrent access safe without locking. mbox stores all messages in one file, which is compact but requires locking and suffers when files grow large. Proprietary formats such as Dovecot’s mdbox trade portability for higher performance on large mailboxes.

How the MDA differs from the MTA and MSA

The MDA is defined by its role, not by a separate product category: the same software package can contain an MTA, an MDA and an IMAP server. The functional split between agents comes from the Internet mail architecture described in RFC 5598, which separates submission, relay and delivery.

AgentMain taskTypical protocolExample software
Mail submission agentAccepts mail from authenticated usersSMTP on port 587Postfix submission service
Mail transfer agentRoutes and relays mail between hostsSMTP on port 25Postfix, Exim
Mail delivery agentStores mail in the local mailboxLMTP or local pipeDovecot LMTP, procmail
Mailbox access serverServes stored mail to clientsIMAP or POP3Dovecot, Cyrus
Roles of the main mail agents

A common misconception is that the email client delivers mail. The client only retrieves messages through IMAP or POP3; the message was already placed in storage by the MDA before the client connected.

Configuring filtering, quotas and error handling

Most operational decisions about an MDA concern filtering rules, quota policy and temporary failure handling. The Sieve language, standardized in RFC 5228, is the preferred filtering mechanism because users can edit rules safely through ManageSieve without shell access.

  • Spam folder routing: a Sieve rule reads the spam score header added earlier by the spam filter and files the message into a Junk folder.
  • Quota enforcement: the MDA rejects or defers a message when the mailbox exceeds its limit, and the chosen behavior decides whether the sender receives a bounce message.
  • Vacation responses: the Sieve vacation extension sends automatic replies with rate limits per sender to avoid mail loops.
  • Duplicate suppression: LMTP status per recipient and message-ID tracking prevent repeated copies after retries.

Error handling should follow one rule: temporary problems must produce temporary failures. If the storage volume is briefly unavailable, the MDA should return a 4xx-class or temporary exit status so the MTA keeps the message in its queue instead of bouncing it.

Failure modes and common configuration mistakes

Delivery-stage failures are hard to diagnose because the sender already received a successful SMTP reply. The following table links typical symptoms to their causes and fixes.

SymptomLikely causeFix
Message accepted but missingSieve rule discarded or misfiled itReview active filters and delivery logs
Duplicate messagesPipe delivery retried after partial successSwitch to LMTP with per-recipient status
Bounces for full mailboxQuota set to permanent rejectionUse temporary deferral with warning messages
Corrupted mbox fileConcurrent writes without lockingMigrate to Maildir or a locking-aware MDA
Wrong file ownershipMDA running as an incorrect system userCorrect the user mapping and permissions
Typical MDA problems and remedies

A security point deserves attention: an MDA that executes user-defined programs, as procmail recipes can, runs code with the privileges of the mailbox owner. Restricting external program execution and keeping the MDA unprivileged limits the damage from malicious messages or misconfigured rules.

The short version

Think of email as a postal system. Mail servers on the Internet act like sorting centers that pass letters from city to city. The mail delivery agent is the local carrier who takes a letter at the last post office and puts it into the right mailbox in your building.

It can also sort your post on the way, for example by putting advertising into a separate tray. When something goes wrong at this last step, a letter can arrive at the building but never reach your box, which is why administrators check the delivery agent first when a message seems to vanish.

Where it makes a difference

A university IT team runs Postfix as its mail transfer agent and Dovecot for about 20,000 student mailboxes. Students complain that some messages from course systems never appear, although the sending systems record successful SMTP delivery. The delivery logs show that Postfix hands messages to Dovecot through a pipe, and that a default Sieve script files all messages with a high spam score into a Junk folder that many students never open.

The team switches the handoff to Dovecot LMTP, adjusts the Sieve rule so that messages from the internal course platform bypass spam routing, and changes quota handling from rejection to temporary deferral with warning emails. Within a semester, support tickets about missing course messages fall to a small fraction of their former volume, and full mailboxes no longer generate bounces to teaching staff.

Published November 28, 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