Email Delivery System
Have you ever wondered how email gets delivered from sender to recipient? To troubleshoot email delivery issues it is very important to understand how email delivery system works.Â Here, I am to discuss how email delivery system works right from sender’s computer to the ultimate destination i.e. the recipient. First of all I am going to list out all the components involved in email delivery system along with a little description for each.
Mail User Agent (MUA)
Mail User Agent (MUA), email client or email reader is a computer program used to manage user’s email. It allows user to fetch email from mailbox, compose/reply/forward email, submitting email to server, handling authentication, encryption etc.
Mail Delivery Agent (MDA)/Local Delivery Agent (LDA)
A mail delivery agent or local delivery agent is a computer application/software responsible to delivery email to locally hosted recipient’s mailbox.
Mail Transfer Agent (MTA)
A mail transfer agent or message transfer agent (MTA) is a computer software which transfers electronic messages between computer to computer using client-server architecture. It is composed of both sending as well as receiving portion of the Simple Mail Transfer Protocol (SMTP). A few examples of MTA are sendmail, exim, esmtp, qmail, postfix and more.
Email Delivery System from sender to recipient
- Sender compose an email using mail user agent (MUA) or email client and hit “Send” button
- Mail user agent (MUA) connects to configured Outgoing (SMTP) server on configured SMTP port.
- Mail user agent (MUA) issues SMTP commands in proper sequence according to the SMTP standards as discussed in article Sending emails using Telnet and hand over an email to mail transfer agent running on outgoing (SMTP) server.
- If the recipient mailbox is hosted locally on the same server then the final delivery of the email is handled by local delivery agent (LDA) or message delivery agent (MDA). Upon final delivery Return-Path field is added to record the return path. Return-Path or envelope from field is used to return bounced messages.
- If the recipient mailbox is hosted on some other remote server then the sending MTA queries for Mail Exchanger (MX) records of recipient domain and retrieves all the available MX records, and resolves least preference MX record to its IP address, then sending MTA try to connect to SMTP server pointed by least preference MX record. Upon successful connection sending MTA transfers email to the receiving MTA. After successful receipt of the email the receiving MTA adds Received trace header field at the top of the message header. If it fails to connect to SMTP server pointed by least preference MX record, then it moves to the next higher preference MX record and so on. This is where the concept of Backup Mail Exchanger (MX) comes into the picture, however we will discuss this in an dedicated article.
- Now since the recipient mailbox is hosted on receiving MTA server, the final delivery is handled by local delivery agent (LDA) running on the server where recipient mailbox is hosted. Upon final delivery Return-Path field is added to record the return path. Return-Path or envelope from field is used to return bounced messages.
- The recipient fetches the received email either using POP3/IMAP protocol in her mail user agent (MUA) or email client. We have a dedicated article which discusses on POP3 Client-Server Communication.
So, that’s all about how email delivery system works. However this is an rough idea about the email delivery system, there are many other security measures which are tested at each stage for example concept of SPF record to reduce spam, anti-spam checking, gray listing, white listing, antivirus etc.
I have taken enough care to avoid any mistake, however if you find any mistake/correction your suggestions will be highly appreciated.