mirror of
1
Fork 0

interpret Precedence: auto_reply as an auto reply (#7137)

Some email clients like to be special and only set the "Precedence" header to "auto_reply" when sending automatic replies.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7137
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: christopher-besch <mail@chris-besch.com>
Co-committed-by: christopher-besch <mail@chris-besch.com>
This commit is contained in:
christopher-besch 2025-03-06 12:49:24 +00:00 committed by Otto
parent 932201fa23
commit fc4458bfbb
2 changed files with 10 additions and 0 deletions

View File

@ -297,6 +297,10 @@ func isAutomaticReply(env *enmime.Envelope) bool {
if autoReply == "yes" {
return true
}
precedence := env.GetHeader("Precedence")
if precedence == "auto_reply" {
return true
}
autoRespond := env.GetHeader("X-Autorespond")
return autoRespond != ""
}

View File

@ -65,6 +65,12 @@ func TestIsAutomaticReply(t *testing.T) {
},
Expected: true,
},
{
Headers: map[string]string{
"Precedence": "auto_reply",
},
Expected: true,
},
}
for _, c := range cases {