diff --git a/CHANGES.txt b/CHANGES.txt index 20142a1..86ae0c6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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] diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index f89f0f3..ba398ba 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -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)