mail processing module?

Syver Enstad syver at NOSPAMcyberwatcher.com
Fri Dec 22 16:34:16 CET 2000


"Michael Haggerty" <mhagger at alum.mit.edu> wrote in message
news:m266kd45m0.fsf at freak.kaiserty.com...

> In fact maybe a better breakdown would be one module that represents
> an email message and allows data to be MIMEd into and out of it, one
> module for sending such messages via SMTP, one module for retrieving
> such messages via POP, and one for retrieving via IMAP.  The
> interfaces for the two retrieving modules should be as close as
> possible, and ideally the interface to the mail-sending routine should
> be generic enough that one could write a module with the same
> interface but that sends emails by writing them to, e.g., sendmail or
> qmail.

Couldn't this be accomplished by extending the mimetools.Message class? I
checking out mail messaging via smtplib yesterday, and saw that the
mimetools.Message class seemed to have rather good support for "decoding" a
received message, but none for building a message. So what I basically felt
I needed was a message class for outgoing messages that could be used with
smtplib.SMTP. What I did to avoid having to think about getting the protocol
right all the time, was to make a small smtpmessage class that allowed you
to set such things as from, to, subject, message. I could then pass in the
SMTP object in the send method.





More information about the Python-list mailing list