MTP Commands
COMMAND SEMANTICS
The MTP commands define the mail transfer or the mail system function requested by the user. The syntax of mailboxes must conform to receiver site conventions (with standard defaults applicable). In response to an MTP transfer command, the mail shall always be transferred over the control connection.
The Mail Transfer Protocol follows the specifications of the TELNET Protocol for all communications over the control connection. Although the language used for TELNET communication can be a negotiated option, the "TELNET language" and the corresponding "TELNET end of line code" are required to be NVT-ASCII and <CRLF> respectively. No other specifications of the TELNET Protocol will be cited.
MTP commands are NVT-ASCII strings terminated by <CRLF>. The command codes themselves are alphabetic characters terminated by the character <SP> (space) if parameters follow and <CRLF> otherwise.
The MTP commands are discussed below. In the description of a few of the commands in this section the possible replies are given explicitly. MTP replies are discussed in the next section.
MAIL (MAIL)
This command allows a sender-MTP to send mail over the control connection. The argument field contains a sender and optional path sequence. If the 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 forwarded to the first host on the list. Following this command line the receiver treats all subsequent characters as mail text from the sender. The mail text is terminated by the character sequence "CRLF.CRLF".
As mail is forwarded along the path sequence, each forwarding host must remove itself from the list. When mail reaches its ultimate destination (the path sequence has only a (possibly empty) destination mailbox), the receiver inserts it into the destination mailbox in accordance with its host mail conventions. If the second argument field is blank (one or more spaces) or empty (<CRLF>), the mail is destined for a printer or other designated place for site general delivery mail. The mail may be marked as sent from the sender as specified by the first argument 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 to list the recipients first, or to send the mail 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 control connection to the receiver. The command may take an argument (e.g., any command name) and return more specific information as a response. The reply is type 211 or 214.
QUIT (QUIT)
This command specifies that the receiver must close the control connection.
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.
COMMAND SYNTAX
The commands (and their functions and semantics) are TELNET NVT-ASCII strings transmitted over the control connection. The functions and semantics of commands are described in the section on MTP Commands. The reply sequences are discussed in the section on Sequencing of Commands and Replies. Scenarios illustrating the use of commands are provided in the section on Typical MTP Scenarios. The command syntax is specified in this section.
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.
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 line code is received.
The syntax is specified below in NVT-ASCII. All characters in the argument field are ASCII characters. Square brackets denote an optional argument field. If the option is not taken, the appropriate default is implied.
The following are the MTP commands:
MAIL <SP> FROM:<sender> [<SP> TO:<path>] <CRLF>
MRSQ [<SP> <scheme>] <CRLF>
MRCP <SP> TO:<path> <CRLF>
HELP [<SP> <string>] <CRLF>
QUIT <CRLF>
NOOP <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> ::= "<" <mailbox> ">"
<path> ::= "<" ["@" <host> "," ...] <mailbox> ">"
<scheme> ::= "R" | "T" | "?"
<string> ::= <char> | <char><string>
<mailbox> ::= <user> "@" <host>
<host> ::= <string>
<user> ::= <string>
<char> ::= any of the 128 ASCII characters except <CR> and <LF>
CONTROL FUNCTIONS
Most time-sharing systems provide mechanisms to allow a terminal user to regain control of a "runaway" process. When used locally, such systems have access to all user-supplied signals, whether these are normal characters or special "out of band" signals. When terminals are connected to the system through the network, the system does not necessarily have access to all user signals; the network's flow control mechanisms may cause such signals to be buffered elsewhere, for example in the user's host.
To counter this problem, the TELNET "Synch" mechanism is used. A Synch signal consists of a TCP Urgent or an NCP Interrupt notification, coupled with the TELNET command DATA MARK (DM). This notification, which is not subject to the flow control pertaining to the TELNET connection, is used to invoke special handling of the data stream by the process which receives it. In this mode the data stream is immediately scanned for a TELNET Interrupt Process (IP) command. (The rationale for the use of the TELNET IP command is to allow an existing server TELNET module to sit "under" the MTP. If this code were directly implemented in the MTP the IP command would be unnecessary.) The TELNET command DM is the synchronizing mark in the data stream which indicates that any special signal has already occurred and the recipient can return to normal processing of the data stream. For a more complete understanding of this mechanism, see the TELNET Protocol Specification in the Internet Protocol Handbook.
The effect of this mechanism is to to discard all characters (up to the DM) between the sender of the Synch and its recipeint. Thus, all characters in the control connection are ignored until the TELNET command DM is received. The full sequence is illustrated below. Each vertical bar (|) represents the boundary between data octets; IAC refers to the TELNET command code Interpret As Command.
Old New
-+-+-+-+-+-----+---+--+---+--+-
...|M|A|I|L| ... |IAC|IP|IAC|DM|...
-+-+-+-+-+-----+---+--+---+--+-