How to read email and do not mark it as READ...?

Anders Eriksson amez at
Sat Sep 15 13:37:45 CEST 2001

On 15 Sep 2001 00:06:28 -0700, jriveramerla at (Jose Rivera)

>   I want to make a script that fetch the email to my HardDisk...
> and works ok, but they leave the message marked as READ
>and I don't want that...
>   I know PowerBuilder can do it, so there must be a way in Python...

Using POP you have to 
issue the 'command' RSET just before QUIT. See RFC 1725


import getpass, poplib

M = poplib.POP3('localhost')
numMessages = len(M.list()[1])
for i in range(numMessages):
    for j in M.retr(i+1)[1]:
        print j
# reset read flag

#close connection

// Anders

More information about the Python-list mailing list