1. SMTP works in two cases:
First, email is transmitted from the client to the server;
Second, transfer data from one server to another
2. SMTP is a request/response protocol. commands and responses are based on ASCII text and end with Cr and LF characters. The response includes a three-digit number indicating the returned status.Code
3. SMTP listens for connection requests on TCP port 25
4. Connection and sending process:
A. Establish a TCP connection
B. The client sends the HELO command to identify the sender, and then the client sends the MAIL command
If the server correctly wishes to use OK as a response, it indicates that it is ready to receive
C. The client sends the RCPT command to identify the recipient of the email. There can be multiple RCPT lines.
The server indicates whether the email is willing to be accepted by the recipient.
D. After the negotiation ends, send an email and use the command data to send it.
E. End the input content and send it together.
F. End sending and exit with the quit command.
5. Two other commands:
VRFY --- used to verify whether a given user's email address exists and receive detailed information about the user.
EXPN --- used to expand the mail list.
6. mail routing process:
The SMTP server routes emails based on the domain name of the recipient in the 'domain Name Service DNS. The SMTP server is based on the MX record in the DNS
The MX record registers the domain name and the relevant SMTP relay host. All emails in this domain should be sent to the host.
If the SMTP server mail.abc.com receives a letter to be sent to the shuser@sh.abc.com:
A. Sendmail requests DNS to provide the cname record of host sh.abc.com. If yes, if cname is sent to shmail.abc.com
Request the cname record of shmail.abc.com until no
B. Assume that the cname is sent to shmail.abc.com, and then the DNS of the Sendmail request @ abc.com domain gives the MX record of shmail.abc.com,
Shmail MX 5 shmail.abc.com
10 shmail2.abc.com
C. Sendmail finally requests dns to give the record of shmail.abc.com, that is, IP address. If the returned value is 1.2.3.4
D. Sendmail connects to 1.2.3.4 and sends the mail to the SMTP backend of the server 1.2.3.4 to the shuser@sh.abc.com.Program
7. SMTP basic command set:
Command description
------------------------------
Helo identifies a user to the server
The sender can cheat and lie, but generally the server can detect it.
Mail initialization Email transmission
Mail from:
RCPT identifies a single email recipient, often behind the MAIL command
Multiple rcpt:
After one or more RCPT commands, data indicates that all Email recipients have been identified, and data transmission is initiated to end.
VRFY is used to verify whether the specified user or email address exists. This command is often disabled by the server for security reasons.
EXPN verifies whether the specified mailbox list exists and expands the mailbox list.
Help query commands supported by the server
No Noop operation, the server should respond OK
Quit end session
Rset resets the session and the current transmission is canceled.
--------------------------------
8. the address specified in the mail from command is called envelope from address. It does not need to be the same as the sender's own address.
Rcpt to is equivalent to the following: the specified receiver address is called envelope to address, but it has nothing to do with the actual to: What is the row.
9. Why is there no RCPT cc or rcpt bcc :?
All receiver negotiation is implemented through the rcpt to command. If it is Bcc, the recipient of the envelope is deleted after the negotiation is sent and received by the recipient.
10. emails are divided into envelope, header, and body.
Envelope from, envelope to and message from:, Message to: are completely irrelevant.
Evnelope is provided by the SMTP backend between server hosts, while message from/to is provided by users. It is also different if there is a colon.
11. How can I check whether a letter is forged in the envelope part?
A. correlated ed rows are correlated.
in the current SMTP mail Transmission System, apart from the internal hosts at both ends of the envelope, consider the
section between the firewalls of two companies, if the two firewall machines are A and B respectively, but the receiver checks the envelope written ed: When the row is found to pass through C. it is forged.
B.
receibed: From galangal.org (turmeric.com [104.128.23.115] by mail .bieberdorf.edu ....
C. manually added to the last received row:
Received: From galangal.org ([region]) by mail .bieberdorf.edu (8.8.8.5)
Received: From lemongrass.org by galangal.org (8.7.3)
Received: From graprao.com by lemongrass.org (8.6.4)