From markpettit at verifaction.com Wed Sep 1 11:51:50 2004 From: markpettit at verifaction.com (Mark Pettit) Date: Wed Sep 1 11:52:15 2004 Subject: [Email-SIG] question on "cc" and "bcc" Message-ID: <20040901115150.3d2fb43d.markpettit@verifaction.com> Dear Email Pythonistas, I am battling to get email sent to persons via "cc" and "bcc". Sadly the documentation does not give specific examples on this, but 12.2.13 does give some small clues. Using the examples, I have extended them slightly as follows : # snip snip ===================== msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you msg['cc'] = cclist # first mod msg['bcc'] = bcclist # second mod # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP() s.connect() s.sendmail(me, [you], msg.as_string()) s.close() # snip snip ==================== But the intended recipients never get the mail (copy or blind copy). Does anyone know why the s.sendmail() repeats the "me" and "you", but doesn't do anything with "cc" and "bcc" ? Has anyone actually done this successfully before - I'm sure that someone has and I've just missed some tiny but crucial point. regards, - Mark Pettit VerifAction Cape Town South Africa -- Mark Pettit VerifAction From andrew at logicalprogression.net Wed Sep 1 11:57:30 2004 From: andrew at logicalprogression.net (Andrew Veitch) Date: Wed Sep 1 11:56:44 2004 Subject: [Email-SIG] question on "cc" and "bcc" In-Reply-To: <20040901115150.3d2fb43d.markpettit@verifaction.com> References: <20040901115150.3d2fb43d.markpettit@verifaction.com> Message-ID: <56BAB020-FBFD-11D8-9125-000D9329A36C@logicalprogression.net> Hi Your confusing two concepts - the concept of creating an email message and the concept of sending it. msg['bcc'] will just add a bcc header to your email which defeats the point of bcc! You'd need to change the sendmail line to something like: s.sendmail(me, [you] + cclist, msg.as_string()) A On 1 Sep 2004, at 10:51, Mark Pettit wrote: > > Dear Email Pythonistas, > > I am battling to get email sent to persons via "cc" and "bcc". Sadly > the documentation does not give specific examples on this, but 12.2.13 > does give some small clues. > > Using the examples, I have extended them slightly as follows : > > # snip snip ===================== > msg['Subject'] = 'The contents of %s' % textfile > msg['From'] = me > msg['To'] = you > msg['cc'] = cclist # first mod > msg['bcc'] = bcclist # second mod > > # Send the message via our own SMTP server, but don't include the > # envelope header. > s = smtplib.SMTP() > s.connect() > s.sendmail(me, [you], msg.as_string()) > s.close() > # snip snip ==================== > > But the intended recipients never get the mail (copy or blind copy). > > Does anyone know why the s.sendmail() repeats the "me" and "you", but > doesn't do anything with "cc" and "bcc" ? > > Has anyone actually done this successfully before - I'm sure that > someone has and I've just missed some tiny but crucial point. > > regards, > > - > Mark Pettit > VerifAction > Cape Town > South Africa > > > -- > Mark Pettit > VerifAction > _______________________________________________ > Email-SIG mailing list > Email-SIG@python.org > Your options: > http://mail.python.org/mailman/options/email-sig/ > andrew%40logicalprogression.net > > > -- Logical Progression Ltd, 20 Forth Street, Edinburgh EH1 3LH, UK Tel: +44 (0)131 550 3733 Web: http://www.logicalprogression.net/ From markpettit at verifaction.com Wed Sep 1 12:09:16 2004 From: markpettit at verifaction.com (Mark Pettit) Date: Wed Sep 1 12:09:49 2004 Subject: [Email-SIG] question on "cc" and "bcc" In-Reply-To: <56BAB020-FBFD-11D8-9125-000D9329A36C@logicalprogression.net> References: <20040901115150.3d2fb43d.markpettit@verifaction.com> <56BAB020-FBFD-11D8-9125-000D9329A36C@logicalprogression.net> Message-ID: <20040901120916.1f6c8b91.markpettit@verifaction.com> Andrew, This is truly amazing - 6 minutes for a reply - I am astounded. You are correct - I did not (until seconds ago) understand the concept too well. The email documentation doesn't really go a great way in making this clearer either. I was very much under the impression that by building the message headers correctly, the "lower layers" would extract those addresses out correctly. Thanks for the assistance. Regards, Mark Pettit On Wed, 1 Sep 2004 10:57:30 +0100 Andrew Veitch wrote: > Hi > > Your confusing two concepts - the concept of creating an email message > and the concept of sending it. > > msg['bcc'] will just add a bcc header to your email which defeats the > point of bcc! > > You'd need to change the sendmail line to something like: > > s.sendmail(me, [you] + cclist, msg.as_string()) > > A > > On 1 Sep 2004, at 10:51, Mark Pettit wrote: > > > > > Dear Email Pythonistas, > > > > I am battling to get email sent to persons via "cc" and "bcc". Sadly > > the documentation does not give specific examples on this, but 12.2.13 > > does give some small clues. > > > > Using the examples, I have extended them slightly as follows : > > > > # snip snip ===================== > > msg['Subject'] = 'The contents of %s' % textfile > > msg['From'] = me > > msg['To'] = you > > msg['cc'] = cclist # first mod > > msg['bcc'] = bcclist # second mod > > > > # Send the message via our own SMTP server, but don't include the > > # envelope header. > > s = smtplib.SMTP() > > s.connect() > > s.sendmail(me, [you], msg.as_string()) > > s.close() > > # snip snip ==================== > > > > But the intended recipients never get the mail (copy or blind copy). > > > > Does anyone know why the s.sendmail() repeats the "me" and "you", but > > doesn't do anything with "cc" and "bcc" ? > > > > Has anyone actually done this successfully before - I'm sure that > > someone has and I've just missed some tiny but crucial point. > > > > regards, > > > > - > > Mark Pettit > > VerifAction > > Cape Town > > South Africa > > > > > > -- > > Mark Pettit > > VerifAction > > _______________________________________________ > > Email-SIG mailing list > > Email-SIG@python.org > > Your options: > > http://mail.python.org/mailman/options/email-sig/ > > andrew%40logicalprogression.net > > > > > > > -- > Logical Progression Ltd, 20 Forth Street, Edinburgh EH1 3LH, UK > Tel: +44 (0)131 550 3733 Web: http://www.logicalprogression.net/ > > -- Mark Pettit VerifAction From barry at python.org Tue Sep 28 21:07:23 2004 From: barry at python.org (Barry Warsaw) Date: Tue Sep 28 21:07:29 2004 Subject: [Email-SIG] Feed parser recipe In-Reply-To: <412E1A5C.8090203@interlink.com.au> References: <1093111617.36.2300@mint-julep.mondoinfo.com> <412E1A5C.8090203@interlink.com.au> Message-ID: <1096398443.2826.108.camel@geddy.wooz.org> I'm just now catching up on email-sig traffic, trying to whip email 3.0 into shape for Python 2.4... On Thu, 2004-08-26 at 13:14, Anthony Baxter wrote: > > In particular, the code solves one problem I've seen in real life > > when using the feed parser. I've seen at least a few spam mails that > > have a content-type of multipart/ but which contain only a > > single part. The feed parser can parse them, but the resulting > > Message object is internally inconsistent: get_main_type() returns > > "multipart" but is_multipart() returns False. In that case, my code > > applies some messy heuristics in an attempt to figure out what the > > right content-type is. > > This was something I recall hitting and deciding that the correct > solution was the current one. I'm not sure what else it could do - > maybe change the multipart to something else and install a .defects, > but this really doesn't appeal to me, at all. Maybe the right thing to do is to leave the message object alone, except to add a .defect. I'm thinking something like MultipartInvariantViolationDefect or somesuch. It's something you could easily test by comparing is_multipart() and get_main_type(), but we might as well do it for you. Matthew, if you have a sanitized version of the offending message still laying around, send it to me or post a SF bug with that as the attachment. Assign it to me and I'll at least add it to the test suite. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/email-sig/attachments/20040928/a290c2f9/attachment.pgp