Understanding Email

Sudip Dutta
4 min readJul 8, 2021

--

One of the most important pieces of technology that every person use these days is E-mail. As the name defines, it is a mail transferred via electronic medium. But have you ever thought what actually happens behind the scene ???

Important Terms:

MUA(Mail User Agent): Also referred to as Email client, these are the applications we use to send and receive mail. There are two types of MUA:- Client based and Web Based.Client based MUA is accessed by application installed on your system whereas Web-based MUA is accessed using web application. Example of Client based MUA are Mozilla Thunderbird, Microsoft Outlook, etc. Examples for web based MUA are Google GMail, Yahoo mail, etc.

MSA(Mail Submission Agent): It is a computer program that receives email messages from an MUA and cooperates with an MTA for delivery of the mail.When sending, your MUA communicates with a specialized mail server, a mail transfer agent (MTA).

MTA(Mail Transfer Agent): Also referred to as mail server, mail exchanger, and MX host, MTA is a software that routes a mail message towards its final destination by sending the message to another MTA. The MTAs communicate with each other via SMTP. It is sometimes referred to as SMTP Server. Examples of MTAs used in mailman are Postfix,Sendmail etc.

MDA(Mail Destination Agent): It is a computer software component that is responsible for the delivery of e-mail messages to receivers mail agent.

SMTP(Simple Mail Transfer Protocol): It is an internet standard communication rules for E-Mail transmission. It operates on port 25. It is part of the application layer of the TCP/IP protocol.

POP/IMAP(Post Office Protocol/Internet Message Access Protocol): Both are application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a mail server. If we use POP, then the whole email will be downloaded to the local computer and the copy at the server gets deleted. If the protocol used is IMAP, then the email message is stored in the mail server itself, but the user can easily manipulate the emails on the mail server as in the local computer.

MX Record: It is an entry in your DNS(Domain Name Server) zone file which specifies a mail server to handle a domain’s email. It shows the IP address of the corresponding SMTP Server.

How Email Works:-

  1. Suppose Jack( Jack@gmail.com ) has to send a mail to Jill( Jill@yahoo.com ).Once Jack composes the mail in the gmail application and clicks “Send”, the MUA adds the email headers to the message. It is similar to putting a letter in an envelope and writing the sender’s and receiver’s address.

2. The MUA then delivers the email to his MSA or MTA/SMTP server. In most cases, MSA and initial MTA are integrated as one program/server. The SMTP server corresponding to Jack’s email service provider can be viewed using mxtoolbox.com.

MX Record

3. Once the email is received, the server needs to look up to which MTA/SMTP server the message need to be send i.e it needs server’s ip address. If Jill is in a very distant place from the place of origin of the mail and also has a different email provider than Jack(which is yahoo), the SMTP server of gmail decides which server manages the mail for the yahoo. The server looks up this information in MX record of DNS server.

4. Once the DNS sends the IP address to the MTA, the MTA will transmit the message to Yahoo’s MTA via different MTAs. The MTA forwards your mail to a MDA. The message will remain stored there until Jill connects to retrieve his mail. When Jill presses “Retrieve mail” in his MUA, the mail client communicates with the server and downloads the mail. This final download is done through POP/IMAP protocol. At last , Jill reads the email using Yahoo web MUA.

Working

Note: When you compose an email in the Gmail website and press “Send” your email is simply sent from your browser to Google’s Server that’s why it’s using HTTPs. Google’s internal server then sends the email using SMTP and receives using IMAP.

But if you are using a software like Outlook,Thunderbird, then you can see that it uses SMTP to send your email and receives using POP/IMAP.

Thanks for reading! I hope you have learned something new.

If you liked my content, do follow me:-

--

--