e-mail Protocols: SMTP, IMAP, POP3

01/01/2022 1 By indiafreenotes

SMTP

Simple Mail Transfer Protocol (SMTP) is the standard protocol for sending emails across the Internet.

By default, the SMTP protocol works on three ports:

Port 25: This is the default SMTP non-encrypted port;

Port 2525: This port is opened on all servers in case port 25 is filtered (by your ISP for example) and you want to send non-encrypted emails with SMTP;

Port 465: This is the port used if you want to send messages using SMTP securely.

Command Description
HELLO
This command initiates the SMTP conversation.
EHELLO
This is an alternative command to initiate the conversation. ESMTP indicates that the sender server wants to use extended SMTP protocol.
MAIL FROM
This indicates the sender’s address.
RCPT TO
It identifies the recipient of the mail. In order to deliver similar message to multiple users this command can be repeated multiple times.
SIZE
This command let the server know the size of attached message in bytes.
DATA
The DATA command signifies that a stream of data will follow. Here stream of data refers to the body of the message.
QUIT
This commands is used to terminate the SMTP connection.
VERFY
This command is used by the receiving server in order to verify whether the given username is valid or not.
EXPN
It is same as VRFY, except it will list all the users name when it used with a distribution list.

IMAP

The Internet Message Access Protocol (IMAP) is a mail protocol used for accessing email on a remote web server from a local client. IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving emails. Both protocols are supported by all modern email clients and web servers.

While the POP3 protocol assumes that your email is being accessed only from one application, IMAP allows simultaneous access by multiple clients. This is why IMAP is more suitable for you if you’re going to access your email from different locations or if your messages are managed by multiple users.

By default, the IMAP protocol works on two ports:

Port 143: This is the default IMAP non-encrypted port;

Port 993: This is the port you need to use if you want to connect using IMAP securely.

Command Description
IMAP_LOGIN
This command opens the connection.
CAPABILITY
This command requests for listing the capabilities that the server supports.
NOOP
This command is used as a periodic poll for new messages or message status updates during a period of inactivity.
SELECT
This command helps to select a mailbox to access the messages.
EXAMINE
It is same as SELECT command except no change to the mailbox is permitted.
CREATE
It is used to create mailbox with a specified name.
DELETE
It is used to permanently delete a mailbox with a given name.
RENAME
It is used to change the name of a mailbox.
LOGOUT
This command informs the server that client is done with the session. The server must send BYE untagged response before the OK response and then close the network connection.

POP3

Post Office Protocol version 3 (POP3) is a standard mail protocol used to receive emails from a remote server to a local email client. POP3 allows you to download email messages on your local computer and read them even when you are offline. Note, that when you use POP3 to connect to your email account, messages are downloaded locally and removed from the email server. This means that if you access your account from multiple locations, that may not be the best option for you. On the other hand, if you use POP3, your messages are stored on your local computer, which reduces the space your email account uses on your web server.

By default, the POP3 protocol works on two ports:

Port 110: This is the default POP3 non-encrypted port;

Port 995: This is the port you need to use if you want to connect using POP3 securely.

Command Description
LOGIN
This command opens the connection.
STAT
It is used to display number of messages currently in the mailbox.
LIST
It is used to get the summary of messages where each message summary is shown.
RETR
This command helps to select a mailbox to access the messages.
DELE
It is used to delete a message.
RSET
It is used to reset the session to its initial state.
QUIT
It is used to log off the session.