fixed handling of smtplib.SMTPException, thanks Paolo

This commit is contained in:
mdipierro
2020-06-14 00:30:56 -07:00
parent ae2425d348
commit 79f64cbe72
+6 -7
View File
@@ -819,13 +819,12 @@ class Mail(object):
# do not want to hide errors raising some exception here
try:
server.quit()
except:
pass
# ensure to close any socket with SMTP server
try:
server.close()
except:
pass
except smtplib.SMTPException:
# ensure to close any socket with SMTP server
try:
server.close()
except Exception:
pass
except Exception as e:
logger.warning('Mail.send failure:%s' % e)
self.result = result