0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-26 09:54:35 +01:00

Add X-Auto-Response-Suppress header to outgoing messages (#6492)

This is a header used to suggest mail servers not to respond to a message
with an auto-responder:

 https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcmail/ced68690-498a-4567-9d14-5c01f974d8b1

This header is also used by github and gitlab in outgoing messages.

Fixes #6484
This commit is contained in:
mrsdizzie 2019-04-02 11:45:54 -04:00 committed by techknowlogick
parent 704da08fdc
commit 54c1cb6c5f

View file

@ -40,6 +40,7 @@ func NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body str
msg.SetHeader("To", to...) msg.SetHeader("To", to...)
msg.SetHeader("Subject", subject) msg.SetHeader("Subject", subject)
msg.SetDateHeader("Date", time.Now()) msg.SetDateHeader("Date", time.Now())
msg.SetHeader("X-Auto-Response-Suppress", "All")
plainBody, err := html2text.FromString(body) plainBody, err := html2text.FromString(body)
if err != nil || setting.MailService.SendAsPlainText { if err != nil || setting.MailService.SendAsPlainText {