[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - MailHost.py:1.76.12.1
Lennart Regebro
lennart@torped.se
Wed, 27 Nov 2002 07:36:24 -0500
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv1425/lib/python/Products/MailHost
Modified Files:
Tag: regebro-collector_694_fix-Branch
MailHost.py
Log Message:
Fix for Collector Issue 694 + fix for the smtp_port being stored as a string in MailHosts upgraded from Zope 2.5.
=== Zope/lib/python/Products/MailHost/MailHost.py 1.76 => 1.76.12.1 ===
--- 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 07:36:23 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'"