From af02957c22c1ddde45d7a404601fd3826a1c8eb0 Mon Sep 17 00:00:00 2001 From: Bastien Durel Date: Wed, 26 Aug 2015 16:43:24 +0200 Subject: [PATCH 1/4] add date header in mail --- utils/mail.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/mail.go b/utils/mail.go index 783a2de8c6..18b9a8591b 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -12,6 +12,7 @@ import ( "net" "net/mail" "net/smtp" + "time" ) func CheckMailSettings() *model.AppError { @@ -101,6 +102,7 @@ func SendMail(to, subject, body string) *model.AppError { headers["Subject"] = html.UnescapeString(subject) headers["MIME-version"] = "1.0" headers["Content-Type"] = "text/html" + headers["Date"] = time.Now().Format(time.RFC822) message := "" for k, v := range headers { From 224e7d1a7b999f4d7c8037844b38f1458f7f673f Mon Sep 17 00:00:00 2001 From: Bastien Durel Date: Wed, 26 Aug 2015 16:45:57 +0200 Subject: [PATCH 2/4] tabify --- utils/mail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/mail.go b/utils/mail.go index 18b9a8591b..81f2f9ac78 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -102,7 +102,7 @@ func SendMail(to, subject, body string) *model.AppError { headers["Subject"] = html.UnescapeString(subject) headers["MIME-version"] = "1.0" headers["Content-Type"] = "text/html" - headers["Date"] = time.Now().Format(time.RFC822) + headers["Date"] = time.Now().Format(time.RFC822) message := "" for k, v := range headers { From ab5b2d12a56bb2470893a1738ff65fe49d1426a5 Mon Sep 17 00:00:00 2001 From: Bastien Durel Date: Wed, 26 Aug 2015 20:17:52 +0200 Subject: [PATCH 3/4] missing tab --- utils/mail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/mail.go b/utils/mail.go index 81f2f9ac78..a0abc0df8a 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -12,7 +12,7 @@ import ( "net" "net/mail" "net/smtp" - "time" + "time" ) func CheckMailSettings() *model.AppError { From dce1f1e98810e5a21355c21537e155498f0448c6 Mon Sep 17 00:00:00 2001 From: Bastien Durel Date: Thu, 27 Aug 2015 15:02:50 +0200 Subject: [PATCH 4/4] Use better format for date, as RFC1123 re-defined it over RFC822, and states 'implementations SHOULD use numeric timezones instead of timezone names' --- utils/mail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/mail.go b/utils/mail.go index a0abc0df8a..7cb1786267 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -102,7 +102,7 @@ func SendMail(to, subject, body string) *model.AppError { headers["Subject"] = html.UnescapeString(subject) headers["MIME-version"] = "1.0" headers["Content-Type"] = "text/html" - headers["Date"] = time.Now().Format(time.RFC822) + headers["Date"] = time.Now().Format(time.RFC1123Z) message := "" for k, v := range headers {