[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost - SendMailTag.py:1.18
Lennart Regebro
lennart@torped.se
Tue, 14 Jan 2003 14:10:40 -0500
Update of /cvs-repository/Zope/lib/python/Products/MailHost
In directory cvs.zope.org:/tmp/cvs-serv18177/lib/python/Products/MailHost
Modified Files:
SendMailTag.py
Log Message:
Merge with HEAD: Collector #763: There was no error when you had a sendmail-tag without specifying a mailhost or smpthost. Also added a missing import.
=== Zope/lib/python/Products/MailHost/SendMailTag.py 1.17 => 1.18 ===
--- Zope/lib/python/Products/MailHost/SendMailTag.py:1.17 Wed Aug 14 18:14:51 2002
+++ Zope/lib/python/Products/MailHost/SendMailTag.py Tue Jan 14 14:10:38 2003
@@ -13,7 +13,7 @@
__rcs_id__='$Id$'
__version__='$Revision$'[11:-2]
-from MailHost import MailBase
+from MailHost import MailBase, MailHostError
from DocumentTemplate.DT_Util import parse_params,render_blocks
from DocumentTemplate.DT_String import String
from socket import gethostname
@@ -64,15 +64,16 @@
subject=None, smtphost=None, port='25',
encode=None)
- for key in ('mailto', 'mailfrom', 'subject', 'smtphost', 'port'):
- if not args.has_key(key):args[key]=''
smtphost=None
-
+
has_key=args.has_key
if has_key('mailhost'): mailhost=args['mailhost']
elif has_key('smtphost'): mailhost=smtphost=args['smtphost']
elif has_key(''): mailhost=args['mailhost']=args['']
else: raise MailHostError, 'No mailhost was specified in tag'
+
+ for key in ('mailto', 'mailfrom', 'subject', 'port'):
+ if not args.has_key(key):args[key]=''
if has_key('encode') and args['encode'] not in \
('base64', 'quoted-printable', 'uuencode', 'x-uuencode',