Reading and writing Mozilla-mail in python
Uwe Grauer
news at grauer-online.de
Tue Dec 9 15:17:29 EST 2003
After playing around with the mailbox an email modules i noticed some
strange behaviours:
after the first message is parsed, i got some (kind of parsing errors).
My code:
def test_copy(infile, outfile):
from mailbox import UnixMailbox
from email import message_from_file as mff
try:
fd = open(infile, 'r')
try:
for message in UnixMailbox(fd, mff):
print message
print '***********************************************'
finally:
fd.close()
except:
pass
return
output from script above:
....
In-Reply-To: <3FB8D0C0.60300 at web.de>
Sender: someone at somewhere.de
Nein, leider noch nicht, komm auch erst in paar Tagen dazu.
Fro
***********************************************
From - Sun Dec 07 02:59:04 2003
X-UIDL: 6165
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
....
Look at the Line: Fro
Whats going on here.
Could someone please verify this?
I'm using python 2.3.2 on Win2000 SP4 + all patches
Thanks,
Uwe
More information about the Python-list
mailing list