MBOX-Line: From MRC at CAC.Washington.EDU  Tue Mar 20 12:48:13 2007
To: imap-protocol@u.washington.edu
From: Mark Crispin <MRC@CAC.Washington.EDU>
Date: Fri Jun  8 12:34:38 2018
Subject: [Imap-protocol] literal usage 
In-Reply-To: <07Mar20.113032pst."57996"@synergy1.parc.xerox.com>
References: <71fe4e760703200717v201c983dq39791707ec286aa5@mail.gmail.com>
	<alpine.OSX.0.83.0703200854420.23026@pangtzu.panda.com>
	<07Mar20.113032pst."57996"@synergy1.parc.xerox.com>
Message-ID: <alpine.WNT.0.83.0703201237200.3340@Tomobiki-Cho.CAC.Washington.EDU>

On Tue, 20 Mar 2007, Bill Janssen wrote:
>> As a general rule, one (and only one) space separates tokens in IMAP.
> In my server implementation, I tried to follow the old rule of "be
> liberal in what you accept, and strict in what you provide."  So
> though arguments to IMAP commands are strictly speaking separated by
> exactly one space, I accept any run of whitespace in place of that
> single space.  I'm speaking only of top-level arguments to a command,
> of course.

Although the practice you describe is relatively common, there are cases 
(SASL comes to mind) in which spaces are highly significant.

I generally agree with what Lyndon said; however to avoid a "pot, kettle, 
black" (or is it, "do what I say, not what I do"?) I assert that there is 
a difference, in cases where one and only one space is called for, 
between:
  . accepting a run of spaces because it was easier to code that way (e.g.,
    something quick & dirty like strtok()).
  . going to extra effort to accept a run of spaces.
In the former case, you aren't actively enforcing every possible aspect of 
syntax; in the latter case, you're deliberately allowing a violation.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

