Email package and mailbox module

Chris Keyes chrisk at nipltd.com
Tue Jan 14 19:03:46 CET 2003


Hi All

I'm a bit new here so if I've missed any relevant posts please point me 
to them :-)

I'm currently trying to extract email messages from a mailbox file 
(mailbox module does this fine as long as running on unix).

I want both the body and the headers (basically to index the contents of 
the message). The RFC822 module will give me the headers and (I think) a 
file type object which is the body (or is it a string)?  msg.fp.read()

But from what I can see the Email module would me a much much better way 
of getting at the contents of the message. I'm just not really sure how 
it works and how to mesh to two together.

Does anyone know of any good examples I may be able to have a good peer 
at? The factory type object thing kinda confused me. I've really only 
done scripting in python rather than 'propper' coding, so any help here 
would be much appreciated.

I should also add that I no longer work for NIP but they have kindly 
provided me with a spam protected inbox while I'm finishing my degree. 
This project is the start of my final year project (a mailing list archive).

Many thanks for your help on this one, you never know I may get back 
into this stuff enough to be able to answer the odd question on here one 
day ;-)

Cheers

ChrisK





More information about the Python-list mailing list