Commit a6784b3e authored by Lennart Regebro's avatar Lennart Regebro

Merge with HEAD: Collector #763: There was no error when you had a...

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.
parent c26d31f9
...@@ -42,6 +42,9 @@ Zope Changes ...@@ -42,6 +42,9 @@ Zope Changes
Bugs Fixed Bugs Fixed
- Collector #763: There was no error when you had a sendmail-tag
without specifying a mailhost or smpthost. Also added a missing import.
- Work around potential BTrees key enumeration bugs in Transience - Work around potential BTrees key enumeration bugs in Transience
package by checking explicitly for error cases. package by checking explicitly for error cases.
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
__rcs_id__='$Id: SendMailTag.py,v 1.17 2002/08/14 22:14:51 mj Exp $' __rcs_id__='$Id: SendMailTag.py,v 1.18 2003/01/14 19:10:38 regebro Exp $'
__version__='$Revision: 1.17 $'[11:-2] __version__='$Revision: 1.18 $'[11:-2]
from MailHost import MailBase from MailHost import MailBase, MailHostError
from DocumentTemplate.DT_Util import parse_params,render_blocks from DocumentTemplate.DT_Util import parse_params,render_blocks
from DocumentTemplate.DT_String import String from DocumentTemplate.DT_String import String
from socket import gethostname from socket import gethostname
...@@ -64,16 +64,17 @@ class SendMailTag: ...@@ -64,16 +64,17 @@ class SendMailTag:
subject=None, smtphost=None, port='25', subject=None, smtphost=None, port='25',
encode=None) encode=None)
for key in ('mailto', 'mailfrom', 'subject', 'smtphost', 'port'):
if not args.has_key(key):args[key]=''
smtphost=None smtphost=None
has_key=args.has_key has_key=args.has_key
if has_key('mailhost'): mailhost=args['mailhost'] if has_key('mailhost'): mailhost=args['mailhost']
elif has_key('smtphost'): mailhost=smtphost=args['smtphost'] elif has_key('smtphost'): mailhost=smtphost=args['smtphost']
elif has_key(''): mailhost=args['mailhost']=args[''] elif has_key(''): mailhost=args['mailhost']=args['']
else: raise MailHostError, 'No mailhost was specified in tag' 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 \ if has_key('encode') and args['encode'] not in \
('base64', 'quoted-printable', 'uuencode', 'x-uuencode', ('base64', 'quoted-printable', 'uuencode', 'x-uuencode',
'uue', 'x-uue'): 'uue', 'x-uue'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment