[Zope] WorldPilot Calendar fixes and (UW) IMAP Options available

Michel Pelletier michel@digicool.com
Sun, 12 Mar 2000 16:50:11 -0800


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