IMAP Problems

Grant Edwards invalid at invalid.invalid
Sat Jul 3 23:12:00 EDT 2010


> I'm trying to write a simple script which displays the basic details 
> of a person's mailbox. My problem is that it causes all the messages 
> to be marked as read on the server,
>
> code, mailboxen= server.list() 
> print mailboxen 
> # if it's called INBOX, then
 
> server.select("INBOX")

You probably want to try examine() instead of select().  That opens
the mailbox in a read-only mode which and should avoid changing any
flag values.

>From RFC3501:

      The EXAMINE command is identical to SELECT and returns the same
      output; however, the selected mailbox is identified as
      read-only. No changes to the permanent state of the mailbox,
      including per-user state, are permitted; in particular, EXAMINE
      MUST NOT cause messages to lose the \Recent flag.
      
-- 
Grant




More information about the Python-list mailing list