New submission from zoof:

When I try sending an email, using smtplib, with the bcc header set, the bcc 
header is included in messages send to the "to" and "cc" addresses. According 
to section 4.5.3 of rfc 822:

    > The contents of this field are not included in copies of the message sent 
to the primary and secondary  recipients.

So this behavior is incorrect. It should not be up to the mail client to ignore 
the bcc field.

Here's a script that can replicate the problem:

#!/usr/bin/env python

import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

body = "this is a test"

#craft the message
fromaddr = 'n...@example.com'
server = smtplib.SMTP('smtp.example.com', 587)
p = 'Hunter2!'
subject = "test"
toaddr = "f...@example.com"
ccaddr = "b...@example.com"
bccaddr = "b...@example.com"

msg = MIMEMultipart()

msg['cc'] = ccaddr
msg['bcc'] = bccaddr
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = subject
 
msg.attach(MIMEText(body, 'plain'))

#send the message
server.starttls()
server.login(fromaddr, p)
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()

----------
components: Library (Lib)
messages: 299278
nosy: zoof
priority: normal
severity: normal
status: open
title: smtplib not honoring bcc header
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31052>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to