Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!amd!amdcad!lll-crg!seismo!brl-adm!ron From: ron@brl-adm.UUCP Newsgroups: mod.sources.doc Subject: rfc821 (4 of 8) Message-ID: <717@brl-adm.ARPA> Date: Mon, 19-May-86 00:00:14 EDT Article-I.D.: brl-adm.717 Posted: Mon May 19 00:00:14 1986 Date-Received: Sat, 24-May-86 22:26:27 EDT Distribution: net Organization: Ballistic Research Lab Lines: 580 Approved: RON@BRL.ARPA RFC 821 August 1982 Simple Mail Transfer Protocol There are restrictions on the order in which these command may be used. The first command in a session must be the HELO command. The HELO command may be used later in a session as well. If the HELO command argument is not acceptable a 501 failure reply must be returned and the receiver-SMTP must stay in the same state. The NOOP, HELP, EXPN, and VRFY commands can be used at any time during a session. The MAIL, SEND, SOML, or SAML commands begin a mail transaction. Once started a mail transaction consists of one of the transaction beginning commands, one or more RCPT commands, and a DATA command, in that order. A mail transaction may be aborted by the RSET command. There may be zero or more transactions in a session. If the transaction beginning command argument is not acceptable a 501 failure reply must be returned and the receiver-SMTP must stay in the same state. If the commands in a transaction are out of order a 503 failure reply must be returned and the receiver-SMTP must stay in the same state. The last command in a session must be the QUIT command. The QUIT command can not be used at any other time in a session. 4.1.2. COMMAND SYNTAX The commands consist of a command code followed by an argument field. 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 "TO" or "to" for the forward-path. Command codes and the argument fields are separated by one or more spaces. However, within the reverse-path and forward-path arguments case is important. In particular, in some hosts the user "smith" is different from the user "Smith". Postel [Page 27] August 1982 RFC 821 Simple Mail Transfer Protocol The argument field consists of a variable length character string ending with the character sequence . The receiver is to take no action until this sequence is received. Square brackets denote an optional argument field. If the option is not taken, the appropriate default is implied. [Page 28] Postel RFC 821 August 1982 Simple Mail Transfer Protocol The following are the SMTP commands: HELO MAIL FROM: RCPT TO: DATA RSET SEND FROM: SOML FROM: SAML FROM: VRFY EXPN HELP [ ] NOOP QUIT TURN Postel [Page 29] August 1982 RFC 821 Simple Mail Transfer Protocol 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. ::= ::= ::= "<" [ ":" ] ">" ::= | "," ::= "@" ::= | "." ::= | "#" | "[" "]" ::= "@" ::= | ::= ::= | ::= | ::= | | "-" ::= | "." ::= | ::= """ """ ::= "\" | "\" | | ::= | "\" ::= "." "." "." ::= | ::= [Page 30] Postel RFC 821 August 1982 Simple Mail Transfer Protocol ::= the carriage return character (ASCII code 13) ::= the line feed character (ASCII code 10) ::= the space character (ASCII code 32) ::= one, two, or three digits representing a decimal integer value in the range 0 through 255 ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case ::= any one of the 128 ASCII characters, but not any or ::= any one of the ten digits 0 through 9 ::= any one of the 128 ASCII characters except , , quote ("), or backslash (\) ::= any one of the 128 ASCII characters (no exceptions) ::= "<" | ">" | "(" | ")" | "[" | "]" | "\" | "." | "," | ";" | ":" | "@" """ | the control characters (ASCII codes 0 through 31 inclusive and 127) Note that the backslash, "\", is a quote character, which is used to indicate that the next character is to be used literally (instead of 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. Note that the name elements of domains are the official names -- no use of nicknames or aliases is allowed. Sometimes a host is not known to the translation function and communication is blocked. To bypass this barrier two 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.2]", which indicates a 32-bit ARPA Internet Address in four 8-bit fields. Postel [Page 31] August 1982 RFC 821 Simple Mail Transfer Protocol The time stamp line and the return path line are formally defined as follows: ::= "Return-Path:" ::= "Received:" ::= ";" ::= "FROM" ::= "BY" ::= [] [] [] [] ::= "VIA" ::= "WITH" ::= "ID" ::= "FOR" ::= The standard names for links are registered with the Network Information Center. ::= The standard names for protocols are registered with the Network Information Center. ::=