How email works
An overview of the ecosystem at it's components
For you to get a first overview of the email ecosystem and how emails are sent and delivered, we briefly present the main components, what they do and how they interact.
The components
The email ecosystem is mainly composed of the following components.
MUA - Mail User Agent
A mail user agent is the component which interfaces with the client that composes the email messages, to be sent, and presents the received email messages. Examples of MUAs are the email client applications like Thunderbird and Ms Outlook. They send email to SMPT servers and receive emails from POP/IMAP.
MTA- Mail Transfer Agent
The Mail Transfer Agent sends and receives emails through SMTP. They are the main component of an email server.
MDA - Mail Delivery Agent
Component that receives a message from the MTA and stores it in the Message Storage, are called a Mail Delivery Agent.
Message Storage
The Message Store is a database or folder structure where email messages are persistently stored.
POP/IMAP Server
The POP/IMAP server is the one with which the MUAs interact to fetch email messages from the message store.
How the components interact in the ecosystem
The user composes a message and request it to be sent, in the MUA. The MUA will interact with the MTA through the SMTP protocol to send the message.
The message will then be passed around one or more MTAs.
If a message is destined for a user on the system, the MTA passes it to a MDA. The MDA will then persist the message in a message store.
When the MUA fetches incoming messages it will interact with a POP/IMAP server to get the messages from the message store.
The postmaster
An entity that was not yet mentioned is the Postmaster, the person responsible to manage an email service/server. You must have a postmaster alias at all domains that handle email. This alias will direct system messages to a person, the postmaster, responsible for the domain email system.
A note on the TO address
An important note, with security impacts, is that the “To:” address in an email message host is not the address that the servers look for to address the email. From the MTAs point of view, the “To:” address is just part of the content of the email message.
In practice, when you compose a message your MUA uses the message “To:” header as the envelope address, but this is not required nor is it always the case.
The actual addresses used for email delivery are the envelope addresses which are specified during the SMPT conversation.
Bottom line, don’t trust the “To:” header field from email messages.