5. Specifications
5.1. MTP Commands
5.1.1. Command Semantics
The MTP commands define the mail transfer or the mail system function requested by the user. MTP commands are character strings terminated by <CRLF>. The command codes themselves are alphabetic characters terminated by <SP> if parameters follow and <CRLF> otherwise. The syntax of mailboxes must conform to receiver site conventions. The MTP commands are discussed below. MTP replies are discussed in the Section 5.2.
MAIL (MAIL)
This command is used to send mail over the transmission channel. The argument field contains a sender-path sequence and optional receiver-path sequence.
The sender-path sequence consists of an optional list of hosts and the sender mailbox. When the list of hosts is present, it is "reverse" source routing information and indicates that the mail was relayed through each host on the list (the first host in the list was the most recent relay). This list is used as source routing to return non-delivery notices to the sender. As each relay host adds itself to the beginning of the list, it must use its name as known in the network to which it is relaying the mail rather than the network from which the mail came (if they are different).
If the receiver-path sequence is present, it consists of an optional list of hosts and a destination mailbox. When the list of hosts is present, it is source routing information and indicates that the mail must be relayed to the first host on the list.
The receiver treats the lines following the command as mail text from the sender. The mail text is terminated by the character sequence "<CRLF>.<CRLF>", (see Section 5.5.2 on Transparency).
As mail is relayed along the receiver-path sequence, each relay host must remove itself from the path sequence and put itself at the beginning of the sender-path sequence. When mail reaches its ultimate destination (the receiver-path sequence has only a destination mailbox), the receiver-MTP inserts it into the destination mailbox in accordance with its host mail conventions. (For example, "MAIL FROM:<X@Y> TO:<@A,@B,C@D> <CRLF>" will eventually be relayed as "MAIL FROM:<@A,X@Y> TO:<@B,C@D> <CRLF>.)
If the receiver-path sequence is empty, the mail is destined for a printer or other designated place for host general delivery mail (if allowed at this host). The mail may be marked as sent from the sender as specified in the sender-path sequence field.
MAIL RECIPIENT SCHEME QUESTION (MRSQ)
This MTP command is used to select a scheme for the transmission of mail to several users at the same host. The schemes are recipients-first, or text-first.
MAIL RECIPIENT (MRCP)
This command is used to identify the individual recipients of the mail in the transmission of mail for multiple users at one host.
HELP (HELP)
This command causes the receiver to send helpful information regarding its implementation status over the transmission channel to the receiver. The command may take an argument (e.g., any command name) and return more specific information as a response.
QUIT (QUIT)
This command specifies that the receiver must close the transmission channel.
NOOP (NOOP)
This command does not affect any parameters or previously entered commands. It specifies no action other than that the receiver send an OK reply.
CONTINUE (CONT)
This command specifies that the previously specified action is to be continued. This is sent only following a preliminary reply.
ABORT (ABRT)
This command specifies that the previously specified action is to be aborted. This is sent only following a preliminary reply. It specifies no further action other than that the receiver send an OK reply.
5.1.2. Command Syntax
The commands begin with a command code followed by an argument field. The command codes are four alphabetic characters. Upper and lower case alphabetic characters are to be treated identically. Thus any of the following may represent the mail command:
MAIL Mail mail MaIl mAIl
This also applies to any symbols representing parameter values, such as R or r for RECIPIENT first. The command codes and the argument fields are separated by one or more spaces.
But, note that in the sender-path and receiver-path arguments case is important. In particular, in some hosts the user "foo" is different from the user "Foo".
The argument field consists of a variable length character string ending with the character sequence <CRLF>. It should be noted that the receiver is to take no action until the end of the line is received.
Square brackets denote an optional argument field. If the option is not taken, the appropriate default is implied. All characters are in the ASCII characters set.
The following are the MTP commands:
MAIL <SP> FROM:<sender-path> [<SP> TO:<receiver-path>] <CRLF>
MRSQ [<SP> <scheme>] <CRLF>
MRCP <SP> TO:<receiver-path> <CRLF>
HELP [<SP> <string>] <CRLF>
QUIT <CRLF>
NOOP <CRLF>
CONT <CRLF>
ABRT <CRLF>
The syntax of the above argument fields (using BNF notation where applicable) is given below. The "..." notation indicates that a field may be repeated one or more times.
<sender-path> ::= <path>
<receiver-path> ::= <path>
<scheme> ::= "R" | "T" | "?"
<string> ::= <char> | <char> <string>
<path> ::= "<" ["@" <host> "," ...] <mailbox> ">"
<host> ::= <a> <string> | "#" <number> | "[" <dotnum> "]"
<mailbox> ::= <user> "@" <host>
<user> ::= <string>
<char> ::= <c> | '\' <c> | '\' <s>
<dotnum> ::= <snum> "." <snum> "." <snum> "." <snum>
<number> ::= <d> | <d> <number>
<snum> ::= three digits representing an integer value in the
range 0 through 255
<specials> ::= '<', '>', '(', ')', '\', ',', ';', ':', '@',
'"', and the control characters (ASCII codes 0 through 37
octal inclusive and 177 octal)
<a> ::= any one of the 26 letters A through Z in either case
<c> ::= any one of the 128 ASCII characters except
<specials>
<d> ::= any one of the ten digits 0 through 9
<s> ::= any one of <specials>
Note that the backslash, '\', is a quote character, which is used to indicate that the next character is to be used literally instead of with its normal interpretation. For example, "Joe\,Smith" could be used to indicate a single nine character user field with comma being the fourth character of the field.
Hosts are generally known by names which are translated to addresses in each host. Sometimes a host is not known to the translation function and communication is blocked. To bypass this barrier numeric forms are also allowed for host "names". One form is a decimal integer prefixed by a pound sign, "#", which indicates the number is the address of the host. Another form is four small decimal integers separated by dots and enclosed by brackets, e.g., "[123.255.37.321]", which indicates a 32 bit ARPA Internet Address in four eight bit fields.