Mail Service and Protocol
January 4, 2025 · 2 min read · Page View:
The process of transfering mail
If you have any questions, feel free to comment below.
Recently, I have been working on DNS of my domain name. And then I need to set up the mail service of my domain name. When I tried many times, I always failed to receive the mail on my phone. Suddenly, I remembered that I didn’t set up IMAP service. So let’s review the mail service and protocol.
The most common mail service is SMTP, POP3, and IMAP.
SMTP #
SMTP(Simple Mail Transfer Protocol)is used to transfer mail between mail servers. It is a protocol based on TCP/IP, and its main task is to define how mail is sent from the sender’s mail server to the receiver’s mail server. SMTP uses a client/server model, with the sender’s mail server acting as the client connecting to the receiver’s mail server.
- Email is submitted by a mail client (mail user agent, MUA) to a mail server (mail submission agent, MSA) using SMTP on TCP port 465. The MSA delivers the mail to its mail transfer agent (MTA). And this process can be done by multiple machines.
- The boundary MTA uses DNS to look up the MX (mail exchanger) record for the recipient’s domain (the part of the email address on the right of @). The MX record contains the name of the target MTA. Based on the target host and other factors, the sending MTA selects a recipient server and connects to it to complete the mail exchange.
- Once the final hop accepts the incoming message, it hands it to a mail delivery agent (MDA) for local delivery. Once delivered to the local mail server, the mail is stored for batch retrieval by authenticated mail clients (MUAs), using Internet Message Access Protocol (IMAP), a protocol that both facilitates access to mail and manages stored mail, or the Post Office Protocol (POP) which typically uses the traditional mbox mail file format
MIME(Multipurpose Internet Mail Extensions)is a standard that extends the format of email messages to support text in character sets other than ASCII, and to allow audio, video, images, and application data to be included in email.
The default port is 25, but it is not secure, so it is recommended to use port with SSL/TLS encryption, such as 587(TLS) or 465(SSL). Details depend on the ISP.
POP3 #
POP3(Post Office Protocol version 3)is a protocol used to download mail from the mail server to the local device. After downloading, the mail on the server is usually deleted or marked as read. It is suitable for users who check mail occasionally through a single device. The operation of POP3 is one-way, which means that the client’s operations are not reflected on the server.
The default port is 110, but it is not secure, so it is recommended to use port with SSL/TLS encryption, such as 995(SSL).
IMAP #
IMAP(Internet Message Access Protocol)is a protocol used to receive mail. It is similar to POP3, which is a mail retrieval protocol. Its main function is to allow mail clients (such as iPhone, Foxmail) to retrieve mail information and download mail from the mail server. IMAP is designed to provide a two-way communication between the webmail and the mail client, so that the client’s operations can be reflected on the server.
The default port is 143, but it is not secure, so it is recommended to use port with SSL/TLS encryption, such as 993(SSL).
Related readings
If you find this blog useful and want to support my blog, need my skill for something, or have a coffee chat with me, feel free to: