473,410 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

POP3 Python Mail Download

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("ne*******@bluebottle.com")
print server.pass_("neurogasm")

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.
Mar 18 '06 #1
1 1727
Kevin F wrote:
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]


You have an inconsistent indent in the two lines above. All the lines in
a block must have the same indent (except sub-blocks of course).

Kent
Mar 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: WebRod | last post by:
Hi everybody, I just would like to download the new mails I received on my POP3 server (and keep a copy on the server) I use PHP 4.3 and IMAP functions (they are compatible with both POP3 and...
6
by: Robin Becker | last post by:
Hi, I'm getting vast numbers of fake upgrade emails containing some kind of virus. My rather old client can be made to reject these based on some patterns in the subject line. They're nearly all...
2
by: Mike Brearley | last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send a non delivery report back to the sender of the email. Background info: I have a domain hosted on a site that offers...
0
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.