Merge pull request 'Log encryption failure tracebacks' (#160) from log-encryption-failures into develop

Reviewed-on: #160
This commit is contained in:
pfm 2024-09-13 12:23:56 +02:00
commit c1d9210c5e
2 changed files with 3 additions and 3 deletions

View file

@ -133,8 +133,8 @@ def _gpg_encrypt_to_bytes(message: EmailMessage, keys, recipients, encrypt_f, lm
msg_copy = _gpg_encrypt_copy(message, keys, recipients, encrypt_f, lmessage)
try:
return msg_copy.as_bytes(policy=SMTPUTF8)
except IndexError:
raise MailSerialisationException()
except IndexError as ie:
raise MailSerialisationException(ie)
def _gpg_encrypt_to_str(message: EmailMessage, keys, recipients, encrypt_f) -> str:

View file

@ -54,7 +54,7 @@ class MailEncryptionProxy:
# If the message can't be encrypted or serialised to a
# stream of bytes, deliver original payload in
# cleartext.
LOG.error('Unable to encrypt message, delivering in cleartext: %s', e)
LOG.exception('Unable to encrypt message, delivering in cleartext')
self._send_unencrypted(operation, envelope, send)
except xport.TransientFailure: