For an electronic mail application you are to describe the SMTP-based communication that takes place between pairs of MTAs. The sender's User Agent gives a formatted message to the sending Message Transfer Agent (MTA). The sending MTA communicates with the receiving MTA using the Simple Mail Transfer Protocol (SMTP). The receiving MTA delivers mail to the receiver's User Agent. After a communication link is initialized, the sending MTA transmits command lines, one at a time, to the receiving MTA, which returns a three-digit coded response after each command is processed. The sender commands are shown below in the order sent for each message. There is more than one RCPT TO line when the same message is sent to several users at the same MTA. A message to users at different MTAs requires separate SMTP sessions.
HELO myname | Identifies the sender to the receiver (yes, there is only one L). |
MAIL FROM: <sender> | Identifies the message sender |
RCPT TO: <user> | Identifies one recipient of the message |
DATA | Followed by an arbitrary number of lines of text comprising the message body, ending with a line containing a period in column one. |
QUIT | Terminates the communication. |
The following response codes are sent by the receiving MTA:
221 | Closing connection (after QUIT) |
250 | Action was okay (after MAIL FROM and RCPT TO specifying an acceptable user, or completion of a message) |
354 | Start sending mail (after DATA) |
550 | Action not taken; no such user here (after RCPT TO with unknown user) |