POP3 Mail Download

Kevin F neurogasm at gmail.com
Sat Mar 18 16:44:44 EST 2006


Having some troubles downloading messages with POP3...

I can connect to the server just fine and list messages without any 
problem with the following code:

------------------------
from poplib import *

server = POP3("mail.bluebottle.com")
print server.getwelcome()
print server.user("neurogasm at bluebottle.com")
print server.pass_("xxxxxxxx")

messagesInfo = server.list()[1]
numMessages = len(messagesInfo)

print numMessages
------------------------



However, if I try to actually download the messages themselves, my 
python editor highlights 'msgSize' and says "invalid syntax" when I run 
the following subsequent lines of code:


------------------------
emails = []
for msg in messagesInfo:
          msgNum = int(split(msg, " ")[0]
         msgSize = int(split(msg, " ")[1]
         if(msgSize < 20000):
             messages = server.retr(msgNum)[1]
             messages = join(message, "\n")
             emails.append(message)
------------------------



anyone know what's wrong? thanks.



More information about the Python-list mailing list