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 } }