email and smtplib modules

Roman Neuhauser neuhauser+python-list#python.org at sigpipe.cz
Sun Apr 10 07:06:39 EDT 2005


# mwm at mired.org / 2005-04-09 16:42:04 -0500:
> "mark.greenbank at gmail.com" <mark.greenbank at gmail.com> writes:
> 
> > Hi,
> >
> > I'm writing a small script that generates email and I've noticed that:
> >
> > 1) one should add the 'To' and 'CC' headers to the email message
> > 2) one needs to specify the recipients in the smtplib sendmail() method
> >
> > Can someone explain how these are related?

    ...

> This design makes many things possible. Most used these days is spam
> delivered to one address while apparently to another.

    What about mailing lists? Quoting from your message as it arrived
    here:

    Return-Path: python-list-bounces+neuhauser+python-list#python.org=sigpipe.cz at python.org
    X-Original-To: neuhauser+python-list#python.org at sigpipe.cz
    From: Mike Meyer <mwm at mired.org>
    To: python-list at python.org

    For the OP:
    
    Return-Path: header contains the envelope sender (SMTP MAIL command)
    X-Original-To: is the envelope recipient (SMTP RCPT command)
    
    So, despite the email claiming to be sent from Mike to the list,
    it's actually from the list to me.

    Please take Mike's note about spam with two grains of salt, the
    distinction between headers and envelope is vital to the SMTP
    protocol and many services built around it.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991



More information about the Python-list mailing list