Hi there,
I am trying to use the poplib library to get emails using the retr
method. The small program bellow works but the message aren't flagged as
read which puzzles me. I believe the pop server is qmail 1.0.6 /
vpopmail 5.2.1 and I am running the following script on Windows using
Pyhton 2.5.
import poplib
import email
pop = poplib.POP3('ma il.server.com')
pop.user('email @server.com')
pop.pass_('pass word')
status, msg_list, octets = pop.list()
for msg_number in [msg.split(' ')[0] for msg in msg_list]:
status, lines, octets = pop.retr(msg_nu mber)
msg = email.message_f rom_string('\n' .join(lines))
if not msg.is_multipar t() and msg.get_content _type() == 'text/plain':
print msg.get('Subjec t')
print msg.get_payload ()
pop.quit()
Why aren't the message flagged as read? Is there a way to manually mark
them read?
Thanks,
EuGeNe -- http://www.3kwa.com
I am trying to use the poplib library to get emails using the retr
method. The small program bellow works but the message aren't flagged as
read which puzzles me. I believe the pop server is qmail 1.0.6 /
vpopmail 5.2.1 and I am running the following script on Windows using
Pyhton 2.5.
import poplib
import email
pop = poplib.POP3('ma il.server.com')
pop.user('email @server.com')
pop.pass_('pass word')
status, msg_list, octets = pop.list()
for msg_number in [msg.split(' ')[0] for msg in msg_list]:
status, lines, octets = pop.retr(msg_nu mber)
msg = email.message_f rom_string('\n' .join(lines))
if not msg.is_multipar t() and msg.get_content _type() == 'text/plain':
print msg.get('Subjec t')
print msg.get_payload ()
pop.quit()
Why aren't the message flagged as read? Is there a way to manually mark
them read?
Thanks,
EuGeNe -- http://www.3kwa.com
Comment