Do not touch original payload in KeepIntact mode

This commit is contained in:
Piotr F. Mieszkowski 2024-07-12 20:30:11 +02:00
parent 8b5d924321
commit e643ce7722
Signed by: pfm
GPG key ID: BDE5BC1FA5DC53D5

View file

@ -134,7 +134,7 @@ class KeepIntact(MailOperation):
def perform(self, message: Message, lmessage: LazyMessage) -> bytes:
"""Return MESSAGE unmodified."""
try:
return message.as_bytes(policy=SMTPUTF8)
return lmessage.get_original_content()
except (IndexError, UnicodeEncodeError, ValueError) as e:
raise MailSerialisationException(e)