The imap class's method for selecting a mailbox in read only mode is subtly broken. Calling i.select('INBOX', readonly=0) will cause the imap library to open the mailbox in EXAMINE mode, not SELECT. def select(self, mailbox='INBOX', readonly=None): if readonly is not None: name = 'EXAMINE' else: name = 'SELECT' So passing what seems to be a boolean option into the function causes unexpected circumstances in client code. Recommend that the comparison be changed to 'if readonly:'. I have verified this code exists in python2.3 and in python cvs head.
Logged In: YES user_id=196212 The manual suggests that "set"ing the 'readonly' flag will disable modifications, and I agree the suggested change would produce the expected behaviour - will check in a fix...