Brilliant! Thanks guys I will have to have a play around later<br><br><div class="gmail_quote">On 4 July 2010 04:12, Grant Edwards <span dir="ltr"><invalid@invalid.invalid></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
> I'm trying to write a simple script which displays the basic details<br>
> of a person's mailbox. My problem is that it causes all the messages<br>
> to be marked as read on the server,<br>
><br>
</div><div class="im">> code, mailboxen= server.list()<br>
> print mailboxen<br>
> # if it's called INBOX, then…<br>
> server.select("INBOX")<br>
<br>
</div>You probably want to try examine() instead of select().  That opens<br>
the mailbox in a read-only mode which and should avoid changing any<br>
flag values.<br>
<br>
>From RFC3501:<br>
<br>
      The EXAMINE command is identical to SELECT and returns the same<br>
      output; however, the selected mailbox is identified as<br>
      read-only. No changes to the permanent state of the mailbox,<br>
      including per-user state, are permitted; in particular, EXAMINE<br>
      MUST NOT cause messages to lose the \Recent flag.<br>
<br>
--<br>
<font color="#888888">Grant<br>
</font><div><div></div><div class="h5"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>