When sending an email, the recipient list is given during the SMTP dialogue through RCTP TO: command. Later, in DATA command, header fields like 'To', 'Cc','bcc' are indicated. Does this RCPT TO list of recipients have to match with the headers indicated in DATA command?
Also, if the recipient is not indicated in RCPT TO, but in the To field of email header, is it going to be delivered to the recipient not in RCPT TO?
You can use the RCPT TO command only after a MAIL FROM command has been issued. If the host system has never heard of the recipient host, the RCPT TO command receives a negative reply. If a name server is used for domain name resolution, MX records are used to resolve the recipient IP address before trying A records.
This is the real recipient in the SMTP protocol. The message will be delivered to this recipient regardless of the message's To: header. An Email client displays the information from the message header, while the delivery of the message is given by the information in the SMTP protocol.
No, they don't have to match. When the message is sent, the SMTP Server (aka Message Transfer Agent or MTA) is creating a so called SMTP envelope which contains the recipients and the sender of the message (see RFC5321):
SMTP transports a mail object. A mail object contains an envelope and content. The SMTP envelope is sent as a series of SMTP protocol units (described in Section 3). It consists of an originator address (to which error reports should be directed), one or more recipient addresses, and optional protocol extension material.
It is, actually, quite often that the RCPT TO: Command has more recipients that the header of the message - one common case is the usage of "blind copies" bcc: (see RFC5321):
Addresses that do not appear in the message header section may appear in the RCPT commands to an SMTP server for a number of reasons. The two most common involve the use of a mailing address as a "list exploder" (a single address that resolves into multiple addresses) and the appearance of "blind copies".
Does this RCPT TO list of recipients have to match with the headers indicated in DATA command?
Nope.
if the recipient is not indicated in RCPT TO, but in the To field of email header, is it going to be delivered to the recipient not in RCPT TO ?
The RCPT. Here's a (modified) transcript from my own SMTP client where I do just what you ask:
CLIENT: MAIL FROM:<[email protected]> SERVER: 250 2.1.0 OK CLIENT: RCPT TO:<[email protected]> SERVER: 250 2.1.5 OK CLIENT: DATA SERVER: 354 Go ahead CLIENT: Subject: Test email CLIENT: From:'John Doe'<[email protected]> CLIENT: To:'John Doe'<[email protected]> CLIENT: This is a test... CLIENT: .
The message was successfully sent to "[email protected]".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With