From ed2f42f3504c766e9a39f8ed4f3ff97ffa0c3c75 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 15 May 2021 19:34:14 +0200 Subject: commands/thread:ForwardCommand: do not construct EmailMessage unnecessarily --- alot/commands/thread.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alot/commands/thread.py b/alot/commands/thread.py index e71bb588..87deab92 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -324,8 +324,6 @@ class ForwardCommand(Command): async def apply(self, ui): message = ui.current_buffer.get_selected_message() - mail = email.message_from_bytes(message.as_bytes(), - policy = email.policy.SMTP) envelope = Envelope(passed = message) @@ -336,6 +334,8 @@ class ForwardCommand(Command): qf = settings.get_hook('forward_prefix') if qf: + mail = email.message_from_bytes(message.as_bytes(), + policy = email.policy.SMTP) quote = qf(name, address, timestamp, message=mail, ui=ui, dbm=ui.dbman) else: -- cgit v1.2.3