cc and bcc with smtplib.py (1.5.2)

Peter Hansen peter at engcorp.com
Sun Oct 1 17:54:31 EDT 2000


Sandipan Gangopadhyay wrote:
> 
> And this also means that the actual recipient specified in the to_addrs need
> not be the one that shows up in the headers at all. It is upto the
> programmer to sync the two.
> 
> Did RFC822 specifically allow this (typical bulk mail case) or is it a case
> where the module allows us to bypass the RFC ?

I'm pretty sure RFC822 says nothing about the mail transport system, or
at least has little to do with SMTP.  It simply talks about the format
of the mail header and specifically the addresses within it. 
(Disclaimer, it's been three years since I even looked at it last.)

The point is that SMTP requires specifying a list of recipients of a
message.  The "recipient" addresses given to an SMTP mailer are
completely independent of the RFC822 headers "To:" "Cc:" and "Bcc:".  A
mail client can and should strip the names out of the Bcc header when it
forwards messages to SMTP, even though it gives those same addresses to
the SMTP server as "recipient" addresses.  In effect, this is *how* the
blind carbon-copy process works: the sending client does the work.

I doubt the Python module is doing anything that would be considered
"bypassing" the standard in this case.  You can experiment with this by
connecting via telnet to an SMTP server and telling it via "rcpt to:"
commands where to send the mail, even though the headers in the message
you actually send say "To:" somebody else entirely.  Totally valid,
totally conformant with standards, and totally taken advantage of by
bulk mailer dweebs throughout the world since time immemorial.

> ----- Original Message -----
> From: "Dag Sunde" <dag at orion.no>
> > I think you add all recipients (including the cc & bcc ones to
> > the comma-separated "to_addrs"-parameter of the sendmail method,
> > and use the MIME headers: "To: ", "From: ", "Cc: " and "Bcc: "
> > to specify which one to show (or not) at the receiving side...
> >
> > "Gilles Lenfant" <glenfant at nospam-e-pack.net> wrote 
> > > Is there an smtp/python expert here who can tell me how to have "cc" and
> > > "bcc" recipients of a mail ?
> > > BTW, it's with python 1.5.2, I use binary extra modules that are not
> > > compliant with 1.6.
> > > Thanks in advance !

-- 
Peter Hansen
Kaval Telecom Inc.



More information about the Python-list mailing list