~sircmpwn/aerc

Parse Reply-To header while parsing envelope v1 PROPOSED

Srivathsan Murali: 1
 Parse Reply-To header while parsing envelope

 1 files changed, 5 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/9053/mbox | git am -3
Learn more about email & git

[PATCH] Parse Reply-To header while parsing envelope Export this patch

---
While trying to reply to a
[comment](https://todo.sr.ht/~sircmpwn/aerc2/19#comment-4760) by email,
I noticed that the To field is filled as "~benburwell <outgoing@sr.ht>"
instead of the Reply-To address in the mail headers, which was
 "~sircmpwn/aerc2#19 <~sircmpwn/aerc2/19@todo.sr.ht>".

Digging deeper, found out that reply-to header is not
parsed in the parseEnvelope function in /worker/lib/parse.go

 worker/lib/parse.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index df9683aa4df7..c3a43ca51362 100644
--- a/worker/lib/parse.go
+++ b/worker/lib/parse.go
@@ -150,6 +150,10 @@ func parseEnvelope(h *mail.Header) (*models.Envelope, error) {
 	if err != nil {
 		return nil, fmt.Errorf("could not read bcc address: %v", err)
 	}
+	replyTo, err := parseAddressList(h, "reply-to")
+	if err != nil {
+		return nil, fmt.Errorf("could not read reply-to address: %v", err)
+	}
 	subj, err := h.Subject()
 	if err != nil {
 		return nil, fmt.Errorf("could not read subject: %v", err)
@@ -163,6 +167,7 @@ func parseEnvelope(h *mail.Header) (*models.Envelope, error) {
 		Subject:   subj,
 		MessageId: msgID,
 		From:      from,
+		ReplyTo:   replyTo,
 		To:        to,
 		Cc:        cc,
 		Bcc:       bcc,
-- 
2.24.0
Thanks!

To git.sr.ht:~sircmpwn/aerc
   3338dce..59c2452  master -> master
View this thread in the archives