Re: smtpupd-12: <SP> optional in replies?

John Beck <jbeck@eng.sun.com> Tue, 01 August 2000 02:47 UTC

Received: from cs.utk.edu (CS.UTK.EDU [128.169.94.1]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id WAA11192 for <drums-archive@odin.ietf.org>; Mon, 31 Jul 2000 22:47:50 -0400 (EDT)
Received: from localhost (daemon@localhost) by cs.utk.edu with SMTP (cf v2.9s-UTK) id WAA04980; Mon, 31 Jul 2000 22:47:05 -0400 (EDT)
Received: by cs.utk.edu (bulk_mailer v1.13); Mon, 31 Jul 2000 22:46:47 -0400
Received: by cs.utk.edu (cf v2.9s-UTK) id WAA04776; Mon, 31 Jul 2000 22:46:46 -0400 (EDT)
Received: from playground.sun.com (marvin@localhost) by cs.utk.edu with ESMTP (cf v2.9s-UTK) id WAA04731; Mon, 31 Jul 2000 22:46:42 -0400 (EDT)
Received: from playground.sun.com (192.9.5.5 -> playground.Sun.COM) by cs.utk.edu (smtpshim v1.0); Mon, 31 Jul 2000 22:46:43 -0400
Received: from opal.eng.sun.com (sun-barr.Sun.COM [192.9.9.1]) by playground.sun.com (8.11.0+Sun/8.11.0) with ESMTP id e712ked19880; Mon, 31 Jul 2000 19:46:40 -0700 (PDT)
Received: from opal (localhost [127.0.0.1]) by opal.eng.sun.com (8.10.2+Sun/8.10.2) with ESMTP id e712kd1133573; Mon, 31 Jul 2000 19:46:40 -0700 (PDT)
Message-Id: <200008010246.e712kd1133573@opal.eng.sun.com>
X-Mailer: exmh version 2.1.2 06/08/2000
To: Gregory Neil Shapiro <gshapiro@gshapiro.net>
cc: drums@cs.utk.edu
Subject: Re: smtpupd-12: <SP> optional in replies?
X-Image-URL: http://playground.sun.com/~jbeck/gif/Misc/john-face.jpg
In-reply-to: Your message of "Sun, 30 Jul 2000 21:43:29 PDT." <14725.1009.660906.108929@monkeyboy.gshapiro.net>
References: <14725.1009.660906.108929@monkeyboy.gshapiro.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Mon, 31 Jul 2000 22:46:39 -0400
From: John Beck <jbeck@eng.sun.com>
List-Unsubscribe: <mailto:drums-request@cs.utk.edu?Subject=unsubscribe>

Gregory> Section 4.2.1 states, "In many cases the SMTP client then simply
Gregory> needs to search for the reply code followed by <SP> at the beginning
Gregory> of a line."

Gregory> Earlier in section 4.2, the document claims the <SP> part of the text
Gregory> portion of the reply and is therefore optional (the ABNF backs up
Gregory> this fact).  The quoted text from 4.2.1 conflicts with this.

I agree that there are some minor inconsistencies here which should be
resolved.  4.2 says:

---
An SMTP reply consists of a three digit number (transmitted as three
numeric characters) followed by some text unless specified otherwise in
this document.  ...  Formally, a reply is defined to be
the sequence: a three-digit code, <SP>, one line of text, and <CRLF>, or a
multiline reply (as defined in section 4.2.1).  Since, in violation of this
specification, the text is sometimes not sent, clients which do not receive
it SHOULD be prepared to process the code alone (with or without a trailing
space character).  ...

In ABNF, server responses are:

  Greeting = "220 " Domain [ SP text ] CRLF
  Reply-line = Reply-code [ SP text ] CRLF
---

and 4.2.1 says:

---
The format for multiline replies requires that every line, except the
last, begin with the reply code, followed immediately by a hyphen, "-"
(also known as minus), followed by text.  The last line will begin with
the reply code, followed immediately by <SP>, optionally some text, and
<CRLF>.  As noted above, servers SHOULD send the <SP> if subsequent
text is not sent, but clients MUST be prepared for it to be omitted.

For example:
   123-First line
   123-Second line
   123-234 text beginning with numbers
   123 The last line

In many cases the SMTP client then simply needs to search for the reply
code followed by <SP> at the beginning of a line, and ignore all
preceding lines.  ...
---

If omitting the text is in violation of this spec, doesn't that mean that
servers MUST send the <SP> and that the [] indicating optional don't belong?
Furthermore, why does 4.2 say clients SHOULD be prepared to do one thing yet
4.2.1 say clients MUST be prepared to do something similar?

I would personally favor tightening the spec, but consistency is the main
thing.  If we can reach consensus on what to say, I'll volunteer to come
up with some text to say it.

-- John