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

Lennart Regebro lennart@torped.se
Wed, 27 Nov 2002 08:20:52 -0500


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

Modified Files:
	MailHost.py 
Log Message:
Fix for Collector Issue 694 + 699. Merge with HEAD.

=== Zope/lib/python/Products/MailHost/MailHost.py 1.76 => 1.77 ===
--- Zope/lib/python/Products/MailHost/MailHost.py:1.76	Sat Oct 12 12:42:14 2002
+++ Zope/lib/python/Products/MailHost/MailHost.py	Wed Nov 27 08:20:52 2002
@@ -141,7 +141,7 @@
     security.declarePrivate( '_send' )
     def _send( self, mfrom, mto, messageText ):
         """ Send the message """
-        smtpserver = SMTP( self.smtp_host, self.smtp_port )
+        smtpserver = SMTP( self.smtp_host, int(self.smtp_port) )
         smtpserver.sendmail( mfrom, mto, messageText )
         smtpserver.quit()
 
@@ -184,7 +184,8 @@
     if mto:
         if isinstance(mto, types.StringType):
             mto=map(lambda x:x.strip(), mto.split(','))
-        mo['To'] = ','.join(mto)
+        if not mo.getheader('To'):
+            mo['To'] = ','.join(mto)
     else:
         if not mo.getheader('To'):
             raise MailHostError,"Message missing SMTP Header 'To'"