[New-bugs-announce] [issue13446] imaplib, fetch: improper behaviour on read-only selected mailboxes

Charalampos Nikolaou report at bugs.python.org
Mon Nov 21 18:04:19 CET 2011

New submission from Charalampos Nikolaou <char.nikolaou at gmail.com>:

I would like to report a misbehaviour on the fetch command of imaplib when used with mailboxes that have been opened as read-only. In such cases, when you fetch a message (using for instance RFC822), the mail is not marked as read (i.e., the flag of the respective message is not set to 'seen'). I have only tested with IMAP over SSL with the server of my organization on which I don't have administration permissions and gmail.

System details
Python: 2.5, 2.6, 2.7.2, 3.0, 3.1, 3.2
Server: Cyrus IMAP4 v2.1.18 and imap.gmail.com

Pseudocode to reproduce the problem:
imap = imaplib.IMAP4_SSL(imap_server)
imap.connect(user, pass)
imap.select(mailbox, readonly=True)
imap.search(None, 'Unseen')
imap.fetch(mid, 'RFC822')

After executing the above code, the message with id mid will not have been marked as read, while it should have been.

Other relevant information:
Access List for my readonly mailbox: group:1 lrsw group:2 p group:3 lrsp group:4 lrswip group:5 lrswipd group:6 lrswipd group:7 lrsw group:8 lrsw group:9 p group:10 p group:11 lrsp group:12 lrsp group:13 lrswip group:14 lrswip group:15 lrswipd group:16 lrswipd group:17 lrswipd group:18 lrswipd

I have to mention that the above access list is the same with the one of another mailbox which is read/write. I mention this just to make clear that the access list does not play any role in this problem.

Hope I haven't forgotten anything. In any case, ask me.

components: Library (Lib)
messages: 148060
nosy: char.nikolaou
priority: normal
severity: normal
status: open
title: imaplib, fetch: improper behaviour on read-only selected mailboxes
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list