Addresses
To deliver mail, a mail handling system must use an addressing system with unique addresses.
In the Internet, the address consists of two parts: a local part and a domain name, separated by an @ sign.
Components of SMTP
First, we will break the SMTP client and SMTP server into two components such as user agent (UA) and mail
transfer agent (MTA).
The user agent (UA) prepares the message, creates the envelope and then puts the message in the envelope.
The mail transfer agent (MTA) transfers this mail across the internet.
SMTP allows a more complex system by adding a relaying system.
Instead of just having one MTA at sending side and one at receiving side, more MTAs can be added, acting either
as a client or server to relay the email.
The relaying system without TCP/IP protocol can also be used to send the emails to users, and this is achieved by
the use of the mail gateway. The mail gateway is a relay MTA that can be used to receive an email.
Working of SMTP
1. Composition of Mail:
A user sends an e-mail by composing an electronic mail message using a Mail User Agent (MUA).
Mail User Agent is a program which is used to send and receive mail.
The message contains two parts: body and header.
The body is the main part of the message while the header includes information such as the sender and
recipient address.
The header also includes descriptive information such as the subject of the message.
In this case, the message body is like a letter and header is like an envelope that contains the recipient's
address.
2. Submission of Mail:
After composing an email, the mail client then submits the completed e-mail to the SMTP server by using
SMTP on TCP port 25.
3. Delivery of Mail:
E-mail addresses contain two parts: username of the recipient and domain name. For
example, [email protected], where "vivek" is the username of the recipient and "gmail.com" is the
domain name.
If the domain name of the recipient's email address is different from the sender's domain name, then MSA
will send the mail to the Mail Transfer Agent (MTA).
To relay the email, the MTA will find the target domain. It checks the MX record from Domain Name
System to obtain the target domain.
The MX record contains the domain name and IP address of the recipient's domain.
Once the record is located, MTA connects to the exchange server to relay the message.
4. Receipt and Processing of Mail:
Once the incoming message is received, the exchange server delivers it to the incoming server (Mail
Delivery Agent) which stores the e-mail where it waits for the user to retrieve it.
5. Access and Retrieval of Mail:
The stored email in MDA can be retrieved by using MUA (Mail User Agent). MUA can be accessed by
using login and password.
IMAP4
Another mail access protocol is Internet Mail Access Protocol, version 4 (IMAP4).
IMAP4 is similar to POP3, but it has more features; IMAP4 is more powerful and more complex.
POP3 is deficient in several ways.
It does not allow the user to organize her mail on the server; the user cannot have different folders on the
server.
In addition, POP3 does not allow the user to partially check the contents of the mail before downloading.
MIME Headers MIME defines five headers, as shown in Figure below, which can be added to the original e-mail
header section to define the transformation parameters:
MIME-Version This header defines the version of MIME used. The current version is 1.1.
Content-Type This header defines the type of data used in the body of the message.
The content type and the content subtype are separated by a slash.
Depending on the subtype, the header may contain other parameters. MIME allows seven different types of data,
listed in Table.
Content-Transfer-Encoding This header defines the method used to encode the messages into 0s and 1s for
transport. The five types of encoding methods are listed in Table below.