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
+2 -3
View File
@@ -819,12 +819,11 @@ class Mail(object):
# do not want to hide errors raising some exception here # do not want to hide errors raising some exception here
try: try:
server.quit() server.quit()
except: except smtplib.SMTPException:
pass
# ensure to close any socket with SMTP server # ensure to close any socket with SMTP server
try: try:
server.close() server.close()
except: except Exception:
pass pass
except Exception as e: except Exception as e:
logger.warning('Mail.send failure:%s' % e) logger.warning('Mail.send failure:%s' % e)