Michel Pelletier wrote:
Ryan Hughes wrote:
"A.J. Rossini" wrote:
>> "RH" == Ryan Hughes <rh@n-h.net> writes:
RH> I took a look at the imap code. it basically complains that RH> the SELECTed folder is not read writable. As far as I can RH> remember the problem may be that UW IMAP locks your folders RH> when they get selected. Possibly you're accessing that folder RH> with a different client concurrently?
Yes! But I think that the concurrency might be happening from Zope/WorldPilot? I.e. that it is submitting another command prior to the first results? I ran (the patched) imaplib.py by itself (it has a "sample session") which gave "reasonable" results...
This might be possible. I'm checking the IMAP code. Possibly we'll need to use EXAMINE on some spots instead of SELECT. Maybe there's a race situation which would explain why it works for some and for some not.
I don't think this is a bug in WU or a concurrency issue, I think it's a funky design decision in imaplib.py
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import imaplib server = imaplib.IMAP4('X.X.X.X') server.login('michel', '******') ('OK', ['LOGIN completed.']) server.select('Public Folders/Mailing Lists/Zope Folder') Traceback (innermost last): File "<pyshell#8>", line 1, in ? server.select('Public Folders/Mailing Lists/Zope Folder') File "C:\Program Files\Python\Lib\imaplib.py", line 468, in select raise self.readonly('%s is not writable' % mailbox) readonly: Public Folders/Mailing Lists/Zope Folder is not writable
server in this case is a Exchange box. There is nothing in section 6.3.1 of rfc2060 that says this should fail. The imaplib authors however seem to have felt otherwise, which is why there is an optional second argument to IMAP4.select():
def select(self, mailbox='INBOX', readonly=None):
Passing a true value to the readonly argument will allow you to select the mailbox, as shown:
server.select('Public Folders/Mailing Lists/Zope Folder', 1) ('OK', ['964'])
-Michel
I saw that, too, but wasn't sure if it behaves the same, because a few lines further up if that parameter is true then it uses EXAMINE instead of SELECT. I haven't made it yet back to the RFC's to check in detail what the exact difference is between the two. If EXAMINE is OK for write operations as well, then that would be fine. But it sounds like it's intended for following read only operations only. I'll check it out... Cheers, Ryan -- Ryan Hughes <rh@n-h.net> ___________________________________________________ WorldPilot Get Synched - http://www.worldpilot.org The Open Source Personal Information Manager Server Powered by Python and Zope - http://www.zope.org