[Imaplib2-devel] raise self.error(self.welcome) error: None

Piers Lauder piers at janeelix.com
Thu Jun 16 13:33:56 BST 2011


On Thu, 16 Jun 2011 13:26:28 +0200, Sebastian Spaeth wrote:
  > 
  > On Thu, 16 Jun 2011 11:16:42 +1000, Piers Lauder <piers at janeelix.com> wrote:
  > >   > > http://pastebin.com/ZHCwTgiS
  > 
  > > The problem here is a malformed command continuation request from the server.
  > > 
  > > imaplib2 expects continutation requests in the form
  > >   "+[<space><optional data>]"
  > > but the server is sending "+OK..." - ie: no space.
	...
  > 
  > My gut feeling is usually to be as lenient as possible if it doesn't
  > cause trouble. But if this runs danger that we misinterpret data from
  > the server as a continuation response, I think we should rather stick to
  > the RFCs here.
  > 
  > One way would be to ignore a valid welcome messages rather than
  > currently do:
  >                 raise self.error(self.welcome)
  > 
  > But then, I feel a little uneasy about this too. self.welcome is "None"
  > in this case, and perhaps we should allow "None" as a valid response?
  > 
  > I am a bit split about how to handle this and what level of brokeness we
  > are prepared to take from IMAP servers.

I've changed the error above to be less uninformative, as in:

  raise self.error('unrecognised server welcome message: %s' % `self.welcome`)

But I don't think we should accept bad syntax here, as who knows what else
this server has broken?






More information about the OfflineIMAP-project mailing list