[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.79.12.1

Andreas Jung andreas@andreas-jung.com
Mon, 7 Jul 2003 12:06:58 -0400


Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv7144/lib/python/Products/MailHost

Modified Files:
      Tag: Zope-2_7-branch
	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.79.12.1 ===
--- 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:06:23 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"