[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.80
Andreas Jung
andreas@andreas-jung.com
Mon, 7 Jul 2003 12:04:53 -0400
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv6651/lib/python/Products/MailHost
Modified Files:
MailHost.py
Log Message:
- Collector #893: Mailhost: munge_header has been broken for addresses
containing the recipients full name
=== Zope/lib/python/Products/MailHost/MailHost.py 1.79 => 1.80 ===
--- Zope/lib/python/Products/MailHost/MailHost.py:1.79 Tue Mar 4 11:29:12 2003
+++ Zope/lib/python/Products/MailHost/MailHost.py Mon Jul 7 12:04:16 2003
@@ -183,7 +183,7 @@
if mto:
if isinstance(mto, types.StringType):
- mto=map(lambda x:x.strip(), mto.split(','))
+ mto = [rfc822.dump_address_pair(addr) for addr in rfc822.AddressList(mto) ]
if not mo.getheader('To'):
mo['To'] = ','.join(mto)
else:
@@ -191,7 +191,7 @@
for header in ('To', 'Cc', 'Bcc'):
v = mo.getheader(header)
if v:
- mto += [addr.strip() for addr in v.split(',')]
+ mto += [rfc822.dump_address_pair(addr) for addr in rfc822.AddressList(v)]
if not mto:
raise MailHostError, "No message recipients designated"