1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-04-05 10:17:00 +00:00

Improved error handling for invalid recipient address

This commit is contained in:
Ozzie Isaacs 2025-03-23 13:55:47 +01:00
parent f0077e73a8
commit 6dd7a023f3

View File

@ -171,6 +171,10 @@ class TaskEmail(CalibreTask):
except MemoryError as e:
log.error_or_exception(e, stacklevel=3)
self._handleError('MemoryError sending e-mail: {}'.format(str(e)))
except (smtplib.SMTPRecipientsRefused) as e:
log.error_or_exception(e, stacklevel=3)
self._handleError('Smtplib Error sending e-mail: {}'.format(
(list(e.args[0].values())[0][1]).decode('utf-8)').replace("\n", '. ')))
except (smtplib.SMTPException, smtplib.SMTPAuthenticationError) as e:
log.error_or_exception(e, stacklevel=3)
if hasattr(e, "smtp_error"):