This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zoof
Recipients zoof
Date 2017-07-26.23:43:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501112612.68.0.83618950649.issue31052@psf.upfronthosting.co.za>
In-reply-to
Content
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 = 'ned@example.com'
server = smtplib.SMTP('smtp.example.com', 587)
p = 'Hunter2!'
subject = "test"
toaddr = "foo@example.com"
ccaddr = "bar@example.com"
bccaddr = "baz@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()
History
Date User Action Args
2017-07-26 23:43:32zoofsetrecipients: + zoof
2017-07-26 23:43:32zoofsetmessageid: <1501112612.68.0.83618950649.issue31052@psf.upfronthosting.co.za>
2017-07-26 23:43:32zooflinkissue31052 messages
2017-07-26 23:43:32zoofcreate