1
0
mirror of https://github.com/containrrr/watchtower.git synced 2025-01-29 18:53:51 +02:00

Add date header to mail (#164)

Added Date header, date format to RFC1123Z
This commit is contained in:
stffabi 2018-02-24 12:12:39 +01:00 committed by GitHub
commit 4eb0000e0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.RFC1123Z)
header["MIME-Version"] = "1.0"
header["Content-Type"] = "text/plain; charset=\"utf-8\""
header["Content-Transfer-Encoding"] = "base64"