Message299278
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() |
|
Date |
User |
Action |
Args |
2017-07-26 23:43:32 | zoof | set | recipients:
+ zoof |
2017-07-26 23:43:32 | zoof | set | messageid: <1501112612.68.0.83618950649.issue31052@psf.upfronthosting.co.za> |
2017-07-26 23:43:32 | zoof | link | issue31052 messages |
2017-07-26 23:43:32 | zoof | create | |
|