From 59c24523af859dfbd2d5d33f46ab8d5c5a347f8f Mon Sep 17 00:00:00 2001
From: Srivathsan Murali <sri@vathsan.com>
Date: Fri, 15 Nov 2019 11:00:44 +0100
Subject: Parse Reply-To header while parsing envelope

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

(limited to 'worker/lib')

diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index df9683a..c3a43ca 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,
-- 
cgit v1.2.3