The Structure of SMTP Protocol
The structure of the Simple Mail Transfer Protocol (SMTP) revolves around sending email to your Internet Service Provider's (ISP) mail server. The mail server transfers it to another mail server until it reaches the intended recipient. This basic mechanism of relaying your email from one mail server to another is what makes SMTP a straightforward process.
-
Simple Mail Transfer Protocol
-
An analogy for SMTP is how gossip is relayed from person to person until it reaches the person being gossiped about. Several ways of relaying the message happens, from a dinner conversation to coffee talks and phone conversations and text messages, but the gossip continues to be passed on. SMTP works similar to that, albeit with a few mechanisms to ensure that the original message being sent to the recipient remains intact. The relaying of messages is also done between mail servers. This is where mail transfers occur, where the email "hops" from one mail server to another.
Email Relay Structure
-
The structure on how email is relayed begins in your computer, which is the Mail User Agent (MUA). When you send an email, the MUA establishes a connection to your mail server through SMTP's port 25. The mail server is called your Mail Submission Agent (MSA). Your mail server sends an acknowledgement to your computer saying that it is received and proceeds to check where it can route your email. Mail servers, like Exchange Servers, have connectors, which makes them both a Mail Submission Agent and a Mail Transfer Agent (MTA).
As a MTA, your mail server relays your message to the Internet, where the domain name of the email address you are sending to will be matched to a domain name in the Internet. If you're sending to someone with an address someone@example.com, then the MTA will locate the domain name example.com and relay your email to example.com's mail server. Example.com's mail server is the Mail Delivery Agent (MDA), which is responsible for sending it to your intended recipient.
-
How MTAs Route Emails.
-
MTAs know where to send your email through the recipient's email address. An email address like someone@example.com is part of the domain example.com. This domain has a server that contains a Mail Exchange record (MX record), which contains the IP addresses that identifies example.com. By identifying the domain, MTAs find the shortest possible route to relay your email.
Open Relay
-
The mechanism of SMTP relay had its drawback. Mail servers were initially configured before to accept any emails from any computer. ISPs are usually assigned a range of IP addresses it can lease to users. Before the rise of spam, anyone can use an ISP's mail server to send email even if the IP address does not belong to the ISP. This led to mail servers being "accused" of sending spam because the emails were traced to them even though they were just "used" by an IP address that's not local to them. To prevent this open relaying, mechanisms of authentication were made to ensure that only IP addresses local to the ISP can relay emails to the mail server.
Non-Delivery Report
-
SMTP have authentication and acknowledgement methods that ensure your email is received by the recipient. Usually, your MTAs send acknowledgement with each other to say that this email could possibly be in this domain based on the email address. when a MTA sends the email to the MDA and the MDA realizes that someone@example.com does not exist, the acknowledgement it sends back to the MTA is a Non-Delivery Report (NDR). NDR is relayed back from one MTA to another until it reaches your mailbox.
-