From c873833a5f70d6900b1d1855ad4ff9b44037fdae Mon Sep 17 00:00:00 2001 From: angrylogic Date: Wed, 25 Apr 2018 12:02:09 -0400 Subject: [PATCH] Include RFC822 From header. (#1743) The DMARC and DKIM email authentication systems both require the RFC822 From header to function. Kolide currently only includes the configured sender address as the SMTP Envelop From address (e.g., the MAIL FROM command). This patch also includes the configured sender address in the RFC822 email From header which should allow these emails to pass both DKIM and DMARC authentication. --- server/mail/mail.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/mail/mail.go b/server/mail/mail.go index 88c4dc04c6..0bfb1b1426 100644 --- a/server/mail/mail.go +++ b/server/mail/mail.go @@ -54,7 +54,8 @@ func getMessageBody(e kolide.Email) ([]byte, error) { mime := `MIME-version: 1.0;` + "\r\n" content := `Content-Type: text/html; charset="UTF-8";` + "\r\n" subject := "Subject: " + e.Subject + "\r\n" - msg := []byte(subject + mime + content + "\r\n" + string(body) + "\r\n") + from := "From: " + e.Config.SMTPSenderAddress + "\r\n" + msg := []byte(subject + from + mime + content + "\r\n" + string(body) + "\r\n") return msg, nil }