[Zope-Checkins] CVS: Zope2 - MailHost.py:1.63
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Fri, 8 Jun 2001 09:30:36 -0400
Update of /cvs-repository/Zope2/lib/python/Products/MailHost
In directory serenade:/tmp/cvs-serv30968/lib/python/Products/MailHost
Modified Files:
MailHost.py
Log Message:
Collector #2290: better handling of subject header in Mailhost.py
--- Updated File MailHost.py in package Zope2 --
--- MailHost.py 2001/06/08 11:29:07 1.62
+++ MailHost.py 2001/06/08 13:30:35 1.63
@@ -206,9 +206,15 @@
messageText = messageText.lstrip()
- if not headers['subject']:
+ if not headers['subject'] and len(headers)==0:
messageText="subject: %s\n\n%s" % (subject or '[No Subject]',
messageText)
+
+ elif not headers['subject']:
+ messageText="subject: %s\n%s" % (subject or '[No Subject]',
+ messageText)
+
+
if mto:
if type(mto) is type('s'):
mto=map(string.strip, string.split(mto,','))
@@ -224,8 +230,13 @@
smtpserver = SMTP(self.smtp_host, self.smtp_port)
smtpserver.sendmail(headers['from'],headers['to'], messageText)
+
def scheduledSend(self, messageText, mto=None, mfrom=None, subject=None,
encode=None):
+ """Looks like the same function as send() - scheduledSend() is nowhere
+ used in Zope. No idea if it is still needed/used (ajung)
+ """
+
headers = extractheaders(messageText)
if not headers['subject']: