From 88d5de97d6c2caf37c693a51daf98f81951a37ac Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Sat, 29 Jun 2024 21:47:38 +0200 Subject: reply: handle the Sender header Sometimes emails will have a Sender: header, that is different from the From: header. The only use of this in the wild I have seen to date is when meeting invitation is forwarded by somebody. The From: header will be the person organising the meeting, and the Sender: will be the person forwarding. Naturally, when one replies (e.g. with on accept), it should go to the meeting oragniser, but sometimes one would want to include the Sender in such a reply. When executing :reply determine the To: address in order of Reply-To:, From:, Sender:. When executing :reply -a, include the Sender: in Cc:. Implements: https://todo.sr.ht/~rjarry/aerc/259 Link: https://www.rfc-editor.org/rfc/rfc4021#section-2.1.3 Changelog-added: Replying to all will include the Sender in Cc. Signed-off-by: Bence Ferdinandy Reviewed-by: Tim Culverhouse Reviewed-by: Tristan Partin Acked-by: Robin Jarry --- lib/rfc822/message.go | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/rfc822/message.go b/lib/rfc822/message.go index 106ee07d..3f0c447e 100644 --- a/lib/rfc822/message.go +++ b/lib/rfc822/message.go @@ -163,6 +163,7 @@ func parseEnvelope(h *mail.Header) *models.Envelope { MessageId: msgID, From: parseAddressList(h, "from"), ReplyTo: parseAddressList(h, "reply-to"), + Sender: parseAddressList(h, "sender"), To: parseAddressList(h, "to"), Cc: parseAddressList(h, "cc"), Bcc: parseAddressList(h, "bcc"), -- cgit