[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.74.6.5
Shane Hathaway
shane@zope.com
Tue, 4 Mar 2003 11:30:24 -0500
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv1464
Modified Files:
Tag: Zope-2_6-branch
MailHost.py
Log Message:
Restored MailHost's ability to send bulk emails using the "Bcc" header to
avoid disclosing the recipients.
=== Zope/lib/python/Products/MailHost/MailHost.py 1.74.6.4 => 1.74.6.5 ===
--- Zope/lib/python/Products/MailHost/MailHost.py:1.74.6.4 Sat Feb 22 10:14:22 2003
+++ Zope/lib/python/Products/MailHost/MailHost.py Tue Mar 4 11:29:53 2003
@@ -187,13 +187,13 @@
if not mo.getheader('To'):
mo['To'] = ','.join(mto)
else:
- if not mo.getheader('To'):
- raise MailHostError,"Message missing SMTP Header 'To'"
- mto = map(lambda x:x.strip(), mo['To'].split(','))
- if mo.getheader('Cc'):
- mto = mto + map(lambda x:x.strip(), mo['Cc'].split(','))
- if mo.getheader('Bcc'):
- mto = mto + map(lambda x:x.strip(), mo['Bcc'].split(','))
+ mto = []
+ for header in ('To', 'Cc', 'Bcc'):
+ v = mo.getheader(header)
+ if v:
+ mto += [addr.strip() for addr in v.split(',')]
+ if not mto:
+ raise MailHostError, "No message recipients designated"
if mfrom:
mo['From'] = mfrom