SMTP protocol original command code and working principle

zhaozj2021-02-16  167

SMTP protocol original command code and working principle

1.smtp is working in two cases: First, email is transferred from the client to the server; the other is from one

A server is transferred to another server.

2.SMTP is a request / response protocol, command, and response are based on ASCII text and end with CR and LF.

. The response includes a three-digit code indicating the return state.

3.SMTP in the TCP Agreement No. 25 port listening connection request

4. Connect and send the process:

a. Establish TCP connection

b. The client sends the helo command to identify the sender's own identity, then the client sends a mail command.

The server is hoped to respond in OK, indicating that the preparation is received.

c. The client sends the RCPT command to identify the planned receiver of the email, and there can be multiple RCPT lines.

The server side indicates whether it is willing to accept mail for the recipient.

d. negotiation end, send mail, send DATA

e. It is sent to the end of the input content.

f. End this time, exit with the quit command.

5. Different two commands:

VRFY --- is used to verify that a given user mailbox exists and receives detailed information about the user.

EXPN --- is used to expand the mailing list.

6. Mail routing process:

The SMTP server is based on the domain name of the program recipients in DNS to route emails. SMTP service

Based on the MX record in DNS, routing email, MX record registers domain names and related SMTP relay hosts

Email belonging to this domain should be sent to the host.

If the SMTP server mail.abc.com receives a letter to Shuser@sh.abc.com:

A.sendmail Request DNS to give the host Sh.abc.com's CNAME record, if there is, if CNAME is to SHMAI

L.Abc.com, then ask the CNAME record of Shmail.abc.com again until it doesn't.

b. Assume that being cname to shmail.abc.com, then sendmail please? # 243; @ Abc.com Domain DNS gives Shmai

L.Abc.com's MX record,

Shmail mx 5 shmail.abc.com

10 shmail2.abc.com

c. Sendmail finally requests DNS to give the A record of Shmail.abc.com, that is, IP address, if the return value is 1

.2.3.4

d. Sendmail and 1.2.3.4 connection, transfer this to Shuser@sh.abc.com to 1.2.3.4 this

Server's SMTP Backstage Program

7.SMTP basic command set:

Command description

------------------------------

Helo identifies user identity to the server

The sender can deceive, lying, but in general, the server can detect.

Mail initialization mail transmission

Mail from:

RCPT identifies a single mail recipient; often behind the mail command

There are multiple RCPT TO:

After the DATA is in a single or multiple RCPT command, it means that all mail recipients have identified and initialize.

Data transmission, end.

VRFY is used to verify that the specified user / mailbox exists; due to safety reasons, servers often

Prohibit this command

EXPN verifies that a given mailbox list exists, expands the mailbox list, and is often disabled.

Help Query Server Support What Ord

NOOP has no operation, the server should respond to OK

Quit End Conclusion

RSET resetting the session, the current transmission is canceled

--------------------------------

8. The address specified in the mail from command is called Envelope from the address, no need to send itself from

The address is consistent.

RCPT TO and the equivalent, the specified recipient address is called the envelope to address, and what is not related to the actual TO: row.

9. Why don't there be RCPT CC and RCPT BCC:?

All recipient negotiations are implemented through the RCPT TO command. If it is BCC, it is negotiated after sending

When the party is received, the envelope is deleted.

10. Mail is divided into a part of the envelope, a part of the header and a part of the letter

Envelope from, Envelope To and Message from :, message to: Not completely

EVNELOPE is provided by the server host SMTP background, and Message from / TO is user mentioned

. There is a free number and difference.

11. How to check if the envelope is inspected whether a letter is forged?

a. Relevance of the ReceiveD line.

Now SMTP mail transmission system, in addition to the internal host processing of both ends,

The part between the two company firewalls, if the two firewall machines are A and B, but the recipient checks the letter

Received: When it was found that C. is forged.

b. RECEIVED: The host and IP address in the line correspond to whether it corresponds to:

Receibed: from galangal.org (Turmeric.com [104.128.23.115] by mail

.bieberdorf.edu ....

c. Manually add it in the last RECEIVED line:

Received: from galangal.org ([104.128.23.115]) by mail .bieberdorf

.edu (8.8.5)

Received: from lemongrass.org by galangal.org (8.7.3)

Received: from graprao.com by lemongrass.org (8.6.4)

转载请注明原文地址:https://www.9cbs.com/read-8646.html

New Post(0)