Skip to content

Commit 19407e5

Browse files
authored
fix(engine): rfc2392 (#5146)
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
1 parent 305a4b2 commit 19407e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

engine/api/mail/mail.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/mail"
1010
"net/smtp"
1111
"text/template"
12+
"time"
1213

1314
"github.com/ovh/cds/sdk"
1415
"github.com/ovh/cds/sdk/log"
@@ -192,6 +193,8 @@ func SendEmail(ctx context.Context, subject string, mailContent *bytes.Buffer, u
192193
headers["From"] = smtpFrom
193194
headers["To"] = to.String()
194195
headers["Subject"] = subject
196+
// https://tools.ietf.org/html/rfc2392
197+
headers["Message-ID"] = fmt.Sprintf("<%d.%s>", time.Now().UnixNano(), smtpFrom)
195198

196199
if isHTML {
197200
headers["Content-Type"] = `text/html; charset="utf-8"`

0 commit comments

Comments
 (0)