From 23275d44a2a6760c3a87d529ecbe753d91616ac3 Mon Sep 17 00:00:00 2001 From: fomk Date: Fri, 16 Feb 2018 11:24:43 +0200 Subject: [PATCH 1/2] Update email.go Added Date header --- notifications/email.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notifications/email.go b/notifications/email.go index c675a11..b12176c 100644 --- a/notifications/email.go +++ b/notifications/email.go @@ -5,6 +5,7 @@ import ( "fmt" "net/smtp" "os" + "time" "strconv" @@ -54,10 +55,13 @@ func (e *emailTypeNotifier) buildMessage(entries []*log.Entry) []byte { // We don't use fields in watchtower, so don't bother sending them. } + t := time.Now() + header := make(map[string]string) header["From"] = e.From header["To"] = e.To header["Subject"] = emailSubject + header["Date"] = t.Format(time.RFC1123) header["MIME-Version"] = "1.0" header["Content-Type"] = "text/plain; charset=\"utf-8\"" header["Content-Transfer-Encoding"] = "base64" From 462760fa7d9579c0acf7937f352a5dc09240c06d Mon Sep 17 00:00:00 2001 From: fomk Date: Fri, 16 Feb 2018 12:44:34 +0200 Subject: [PATCH 2/2] Update email.go Changed date format to RFC1123Z --- notifications/email.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications/email.go b/notifications/email.go index b12176c..f6d252c 100644 --- a/notifications/email.go +++ b/notifications/email.go @@ -61,7 +61,7 @@ func (e *emailTypeNotifier) buildMessage(entries []*log.Entry) []byte { header["From"] = e.From header["To"] = e.To header["Subject"] = emailSubject - header["Date"] = t.Format(time.RFC1123) + header["Date"] = t.Format(time.RFC1123Z) header["MIME-Version"] = "1.0" header["Content-Type"] = "text/plain; charset=\"utf-8\"" header["Content-Transfer-Encoding"] = "base64"