Merged in [7766] from rjsparks@nostrum.com:

Improves the robustness of the SMTP error handling utilities. Fixes bug #1409.
 - Legacy-Id: 7810
Note: SVN reference [7766] has been migrated to Git commit 393422b36b
This commit is contained in:
Henrik Levkowetz 2014-05-31 16:58:43 +00:00
commit 7ce5516904

View file

@ -306,7 +306,7 @@ def smtp_error_user_warning(thing,request):
if request:
warning = "An error occured while sending email:\n"
if (e.original_msg):
if getattr(e,'original_msg',None):
warning += "Subject: %s\n" % e.original_msg.get('Subject','[no subject]')
warning += "To: %s\n" % e.original_msg.get('To','[no to]')
warning += "Cc: %s\n" % e.original_msg.get('Cc','[no cc]')