MBOX-Line: From guenther+imap at sendmail.com  Fri Jan 25 20:13:38 2008
To: imap-protocol@u.washington.edu
From: Philip Guenther <guenther+imap@sendmail.com>
Date: Fri Jun  8 12:34:41 2018
Subject: [Imap-protocol] example of authentication PLAIN with imap? 
In-Reply-To: <08Jan25.195809pst."58696"@synergy1.parc.xerox.com>
References: <08Jan25.155553pst."58696"@synergy1.parc.xerox.com>
	<alpine.WNT.1.00.0801251607230.3096@Tomobiki-Cho.CAC.Washignton.EDU>
	<08Jan25.172524pst."58696"@synergy1.parc.xerox.com>
	<alpine.WNT.1.00.0801251732060.3096@Tomobiki-Cho.CAC.Washignton.EDU>
	<08Jan25.195809pst."58696"@synergy1.parc.xerox.com>
Message-ID: <Pine.BSO.4.64.0801252104020.9300@vanye.mho.net>

On Fri, 25 Jan 2008, Bill Janssen wrote:
...
> So I believe that a plain authentication challenge should look something
> like this (for valid account with username "janssen", password "foo"):
>
> C: 4 authenticate plain\r\n
> S: +\r\n
> C: AGphbnNzZW4AZm9v\r\n
> S: 4 OK authenticate\r\n
>
> D'accord?

Nope.  You didn't check the syntax for a command continuation request 
response.  On page 84 of RFC 3501 we find:

continue-req    = "+" SP (resp-text / base64) CRLF

I.e., the space after the plus-sign is mandatory, even when the base64 is 
empty.  So make the first server line above:
  S: + \r\n

The rest of that looks correct to me.

As a side-note, the server should consider including in the tagged OK 
response to AUTHENTICATE a CAPABILITY response code that lists the 
capaibilities that are useful after authentication.  e.g.,

  S: 4 OK [CAPABILITY IMAP4rev1 IDLE MULTIAPPEND X-MOTTO] Authentication succeeded\r\n

(c.f. section 6.2.2p9 for details and when not bother)


Philip Guenther

