X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/28bb6b1036f980f09b0e7c7d9516983488566e1e..01e93f28b2829fd3924a3b6021a201c1b6ed3d72:/forum/utils/mail.py diff --git a/forum/utils/mail.py b/forum/utils/mail.py index 8016b00..84a79b3 100644 --- a/forum/utils/mail.py +++ b/forum/utils/mail.py @@ -94,12 +94,15 @@ def create_and_send_mail_messages(messages): logging.error("Couldn't send mail using the sendmail method: %s" % e) try: connection.quit() - connection = None - except Exception: + except Exception, e: + logging.error(e) + finally: connection = None try: connection.quit() + except AttributeError: + pass except socket.sslerror: connection.close() except Exception, e: