Fix a typo in bouncing, wrap UnicodeEncodeError in custom exception
This commit is contained in:
parent
e28864074c
commit
b67a2744cd
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ class MailEncryptionProxy:
|
||||||
if conf.should_log_headers():
|
if conf.should_log_headers():
|
||||||
LOG.error('Erroneous message headers: %s', self._beginning(envelope))
|
LOG.error('Erroneous message headers: %s', self._beginning(envelope))
|
||||||
|
|
||||||
return xport.RESULT_ERRORR
|
return xport.RESULT_ERROR
|
||||||
|
|
||||||
return xport.RESULT_OK
|
return xport.RESULT_OK
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ class KeepIntact(MailOperation):
|
||||||
"""Return MESSAGE unmodified."""
|
"""Return MESSAGE unmodified."""
|
||||||
try:
|
try:
|
||||||
return message.as_bytes(policy=SMTPUTF8)
|
return message.as_bytes(policy=SMTPUTF8)
|
||||||
except IndexError as e:
|
except (IndexError, UnicodeEncodeError) as e:
|
||||||
raise MailSerialisationException(e)
|
raise MailSerialisationException(e)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
Loading…
Reference in a new issue