Writing redirected e-mail to file

Jacobus van der Merwe jacobus at geo.co.za
Tue Mar 13 07:56:15 EST 2001


Hi,

I use sendmail to redirect e-mails to a certain e-mail address to a
script.
This script must 'look' at the headers and body of the e-mail, and then
write the e-mail body to a file.

I can't figure out exactly how to do this:

I use rfc822.Message to get the headers, but how do I get the body?

Can one use mimetools.Message?   What does 'fp' in mimetools.Message
parameters mean?  Once read with mimetools.Message, how do I write
it to a textfile.

The body will consist of only plain text.

Regards,

Jacobus





More information about the Python-list mailing list