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 d3f1aa3a02
commit 0ef3012e33
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):