[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.79
Shane Hathaway
shane@zope.com
Tue, 4 Mar 2003 11:29:44 -0500
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv961
Modified Files:
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.78 => 1.79 ===
--- Zope/lib/python/Products/MailHost/MailHost.py:1.78 Sat Feb 22 10:13:32 2003
+++ Zope/lib/python/Products/MailHost/MailHost.py Tue Mar 4 11:29:12 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