summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-04-02 11:45:54 -0400
committertechknowlogick <matti@mdranta.net>2019-04-02 11:45:54 -0400
commit54c1cb6c5f89f12bb8c032d83f069df3d388bd07 (patch)
tree9b7c25b326667fa74910b76142a7a01da04a760f /modules/mailer
parent704da08fdc6bae6fdd6bf1b892ebe12afeef5eca (diff)
downloadgitea-54c1cb6c5f89f12bb8c032d83f069df3d388bd07.tar.gz
gitea-54c1cb6c5f89f12bb8c032d83f069df3d388bd07.zip
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
Diffstat (limited to 'modules/mailer')
-rw-r--r--modules/mailer/mailer.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 6120068d49..84da0d4c17 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -40,6 +40,7 @@ func NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body str
msg.SetHeader("To", to...)
msg.SetHeader("Subject", subject)
msg.SetDateHeader("Date", time.Now())
+ msg.SetHeader("X-Auto-Response-Suppress", "All")
plainBody, err := html2text.FromString(body)
if err != nil || setting.MailService.SendAsPlainText {