2. Specifications
2.1. Command List
USER <SP> <username> <CRLF>
PASS <SP> <password> <CRLF>
DATA <CRLF>
NOOP <CRLF>
QUIT <CRLF>
2.2. Reply List
220 Message Posting Service Ready.
221 Closing Connection.
250 Command OK.
354 Enter mail, end with <CRLF>.<CRLF>
451 Local error encountered.
500 Command unrecognized.
501 Argument syntax error.
503 Illegal command sequence.
530 Authentication Failure.
550 Error.
2.3. Command and Reply Descriptions
USER <SP> <username> <CRLF>
The USER command informs the message posting server about the username of the user trying to submit mail to the network. The required argument for the USER command is a string specifying the message sender's username.
The USER command can only be used under three conditions:
- when the session with the message posting server has just started;
- right after a message text (terminated by the "<CRLF>.<CRLF>" sequence) has been successfully submitted to the message posting server;
- right after a USER command that gets the reply code 501.
List of possible reply codes for the USER command:
- 250 The username of the message sender has been accepted.
- 451 Internal error has occurred in the message posting server.
- 501 Syntax error detected in the username argument.
- 503 The USER command has been used under an inappropriate condition (i.e., one that is not specified above).
It is recommended that the message posting server should return 250 even if the username is not recognized by the message posting server, as long as the username is syntactically correct. This is an attempt to prevent the message posting server from releasing too much information about the user database. Client should not be able to test the existence of a certain username.
PASS <SP> <password> <CRLF>
The PASS command is used to inform the message posting server about the password associated with the username previously specified. The required argument for the PASS command is a string specifying the message sender's password.
The PASS command can only be used under two conditions:
- right after a USER command that gets the reply code 250;
- right after a PASS command that gets the reply code 501.
List of possible reply codes for the PASS command:
- 250 The password has been accepted and verified to be correctly associated with the username previously specified.
- 451 Internal error has occurred in the message posting server.
- 501 Syntax error detected in the password argument.
- 503 The PASS command has been used under an inappropriate condition (i.e., one that is not specified above).
- 530 The password provided is not the one associated with the username previously specified.
DATA <CRLF>
The DATA command is used to inform the message posting server to get ready to accept a mail message text. No argument is expected. (This command has the same meaning as the DATA command defined in RFC 821.)
The DATA command can only be used under two conditions:
- right after a PASS command that gets the reply code 250;
- right after a mail message text has been successfully accepted from the client.
List of possible reply codes for the DATA command:
- 354 The message posting server is ready to accept the mail message text.
- 451 Internal error has occurred in the message posting server.
- 503 The DATA command has been used under an inappropriate condition (i.e., one that is not specified above).
Upon receiving the reply code 354 for the DATA command, the client should submit the mail message text to message posting server and terminate the text by the sequence "<CRLF>.<CRLF>" as defined in RFC 821. If the message text includes the "<CRLF>.<CRLF>" sequence, then the sequence is replaced by the "<CRLF>..<CRLF>" sequence as defined in RFC 821. The extra "." token will not be included in the final copy of the submitted message.
Upon receiving the mail message text terminated by the "<CRLF>.<CRLF>" sequence, list of possible reply codes is:
- 250 The mail message text has been successfully queued for delivery.
- 451 Internal error has occurred in the message posting server and the mail message text has not been queued.
NOOP <CRLF>
The NOOP command does not cause any action to be performed by the message posting server. Instead, it tests the status of the message posting server. No argument is expected.
The NOOP command cannot be used under one condition:
- right after a DATA command that gets the reply code 354 (i.e., when the message posting server is expecting the client to submit the mail message text).
List of possible reply codes for the NOOP command:
- 250 The message posting server has not encountered any internal error.
- 451 Internal error has occurred in the message posting server during the current session.
QUIT <CRLF>
The QUIT command is used to terminate the session with the message posting server. No argument is expected.
The QUIT command can be used under any condition. The message posting server should always return the reply code 221 for the QUIT command.