From 2f38333f8e8ddb817e752389f6d5b688d79edb33 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 15 May 2021 19:32:33 +0200 Subject: commands/thread: pass bytes to Attachment, not str Attachment payload should always be bytes. --- alot/commands/thread.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/alot/commands/thread.py b/alot/commands/thread.py index be1153aa..d0926692 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -356,9 +356,7 @@ class ForwardCommand(Command): envelope.attach(a) else: # attach original mode - # attach original msg - data = mail.as_string() - a = Attachment(data, 'message/rfc822', None, ()) + a = Attachment(message.as_bytes(), 'message/rfc822', None, ()) envelope.attach(a) # copy subject -- cgit v1.2.3