I have an email application that generates a big file of all the emails ever received by each person. I am using python's email.Parser module to read the big file and process each message later for logging purposes. All emails generated via the web email application are multi-part, and when I parse the big file, it turns the first email into a
(
Read more... )
Comments 3
Also have a look around the net for other python mail handlers or people with the same problem.
Reply
import mailbox
f = open('mailfile','r')
box = mailbox.mbox(f)
for message in box:
# message is an email.Message
pass
Some more examples here.
Reply
Reply
Leave a comment