Fix a typo in bouncing, wrap UnicodeEncodeError in custom exception

This commit is contained in:
Piotr F. Mieszkowski 2024-03-03 21:41:15 +01:00
parent e28864074c
commit b67a2744cd
Signed by: pfm
GPG Key ID: BDE5BC1FA5DC53D5
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class MailEncryptionProxy:
if conf.should_log_headers():
LOG.error('Erroneous message headers: %s', self._beginning(envelope))
return xport.RESULT_ERRORR
return xport.RESULT_ERROR
return xport.RESULT_OK

View File

@ -131,7 +131,7 @@ class KeepIntact(MailOperation):
"""Return MESSAGE unmodified."""
try:
return message.as_bytes(policy=SMTPUTF8)
except IndexError as e:
except (IndexError, UnicodeEncodeError) as e:
raise MailSerialisationException(e)
def __repr__(self):