From 72a148b4a94960d7e158e35719c59c2dedf2f56b Mon Sep 17 00:00:00 2001 From: gutmet Date: Sun, 26 May 2019 19:37:33 +0200 Subject: [PATCH] force reply-to list address because of defective android mail clients --- picolist.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/picolist.go b/picolist.go index 509ab97..800888d 100644 --- a/picolist.go +++ b/picolist.go @@ -101,13 +101,15 @@ func isAllowed(mail *mail.Message, f flags, owners hashset) (bool, error) { } func setHeaderFields(mail *mail.Message, listname string, f flags) { - sender := f.returnPath() + bounceAddress := []string{"<" + f.returnPath() + ">"} + listAddress := []string{"<" + listname + ">"} mail.Header["Precedence"] = []string{"list"} - mail.Header["Sender"] = []string{"<" + sender + ">"} - mail.Header["Errors-To"] = []string{sender} - mail.Header["List-Id"] = []string{"<" + listname + ">"} + mail.Header["Sender"] = bounceAddress + mail.Header["Errors-To"] = bounceAddress + mail.Header["List-Id"] = listAddress if !f.newsletter { mail.Header["List-Post"] = []string{""} + mail.Header["Reply-To"] = listAddress } }