From 6cd1b44cf557a7d7467a74828b0f503b84bcb10c Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 10 Dec 2021 06:46:56 +0000 Subject: [PATCH] commands: thread: Reference existing message when forwarding When forwarding a mail, the outgoing mail, and any follow up conversation becomes a disjointed thread. This removes the original context, and makes it harder to find and track while the conversation splits in two directions. Add appropriate reference headers to the envelope when constructing a forwarded mail to ensure that the conversations continue to be related and therefore presented in the same thread with notmuch and alot. Signed-off-by: Kieran Bingham --- alot/commands/thread.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alot/commands/thread.py b/alot/commands/thread.py index ad3839991..18253bee7 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -361,6 +361,10 @@ async def apply(self, ui): subject = fsp + subject envelope.add('Subject', subject) + # Set forwarding reference headers + envelope.add('References', '<%s>' % self.message.get_message_id()) + envelope.add('X-Forwarded-Message-Id', '<%s>' % self.message.get_message_id()) + # set From-header and sending account try: from_header, account = determine_sender(mail, 'reply')