Fix SMTP exception when an email is send to the moderator.

svn path=/plone.app.discussion/trunk/; revision=46013
This commit is contained in:
Timo Stollenwerk 2010-11-29 08:27:09 +00:00
parent e3eaef18b8
commit b26d5a5a62
2 changed files with 17 additions and 8 deletions

View File

@ -4,6 +4,9 @@ Changelog
1.0RC1 (unreleased)
-------------------
- Fix SMTP exception when an email is send to the moderator.
[timo]
- Make sure comment UIDs in the catalog are always unique. This fixes
http://dev.plone.org/plone/ticket/10652.
[timo]

View File

@ -307,11 +307,14 @@ def notify_moderator(obj, event):
if PLONE_4:
try:
mail_host.send(message, mto, sender, subject, charset='utf-8')
except SMTPException:
logger.error('SMTP exception while trying to send an ' +
'email from %s to %s',
except SMTPException, e:
logger.error('SMTP exception (%s) while trying to send an ' +
'email notification to the comment moderator ' +
'(from %s to %s, message: %s)',
e,
sender,
comment.author_email)
mto,
message)
else: # pragma: no cover
try:
mail_host.secureSend(message,
@ -319,8 +322,11 @@ def notify_moderator(obj, event):
sender,
subject=subject,
charset='utf-8')
except SMTPException:
logger.error('SMTP exception while trying to send an ' +
'email from %s to %s',
except SMTPException, e:
logger.error('SMTP exception (%s) while trying to send an ' +
'email notification to the comment moderator ' +
'(from %s to %s, message: %s)',
e,
sender,
comment.author_email)
mto,
message)