[Python-bugs-list] imaplib - not complying with RFC (PR#218)
Sun, 27 Feb 2000 21:29:55 -0500 (EST)
Full_Name: Lucas de Jonge
Submission from: pad-cache1-1.cache.telstra.net (188.8.131.52)
I am attempting to use the IMAP4 functionality of the imaplib.py module and have
discovered the following problem:
At line 465 of this module, it checks for a response of "READ-WRITE" as a return
key, if you have readwrite access to the selected mailbox. If it doesn't receive
this key, it traps out with a readonly exception. The IMAP server I am
connecting to does not return this value, though it does return "READ-ONLY" if I
open in readonly mode.
This is in fact correct behaviour according to the RFC 2060 (Section 6.3.1). The
server SHOULD return READ-WRITE. According to the definition of SHOULD in the
document, it does not need to, though highly recommended. Note that it MUST
return READ-ONLY if that is the case.
A better way to recode this is to search for the value "READ-ONLY" and then trap
if it is found. I would do this patch for you myself, expect I have only been
coding Python for 2 weeks, and am not familiar with the potential side effects
of this change. I have, in the meantime, hacked my libs to remove the offending
code, and I am working OK.
It is possible that this has already been addressed/discovered but I can't find
in your lists.
Fix it when you will!
Thank you for a very good product.