mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-06 22:47:37 +03:00
check/dkim: Don't replace reason with "body limit used" on error
Additional checks were executed on broken signatures too.
This commit is contained in:
parent
21d842ba3e
commit
ac7f4d5bc1
1 changed files with 12 additions and 6 deletions
|
@ -149,12 +149,8 @@ func (d dkimCheckState) CheckBody(header textproto.Header, body buffer.Buffer) m
|
||||||
|
|
||||||
res := module.CheckResult{AuthResult: make([]authres.Result, 0, len(verifications))}
|
res := module.CheckResult{AuthResult: make([]authres.Result, 0, len(verifications))}
|
||||||
for _, verif := range verifications {
|
for _, verif := range verifications {
|
||||||
var val authres.ResultValue
|
val := authres.ResultValue(authres.ResultPass)
|
||||||
if verif.Err == nil {
|
if verif.Err != nil {
|
||||||
goodSigs = true
|
|
||||||
d.log.Debugf("good signature from %s (%s)", verif.Domain, verif.Identifier)
|
|
||||||
val = authres.ResultPass
|
|
||||||
} else {
|
|
||||||
val = authres.ResultFail
|
val = authres.ResultFail
|
||||||
d.log.Printf("%v (domain = %s, identifier = %s)", strings.TrimPrefix(verif.Err.Error(), "dkim: "), verif.Domain, verif.Identifier)
|
d.log.Printf("%v (domain = %s, identifier = %s)", strings.TrimPrefix(verif.Err.Error(), "dkim: "), verif.Domain, verif.Identifier)
|
||||||
if dkim.IsPermFail(err) {
|
if dkim.IsPermFail(err) {
|
||||||
|
@ -163,8 +159,18 @@ func (d dkimCheckState) CheckBody(header textproto.Header, body buffer.Buffer) m
|
||||||
if dkim.IsTempFail(err) {
|
if dkim.IsTempFail(err) {
|
||||||
val = authres.ResultTempError
|
val = authres.ResultTempError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res.AuthResult = append(res.AuthResult, &authres.DKIMResult{
|
||||||
|
Value: val,
|
||||||
|
Domain: verif.Domain,
|
||||||
|
Identifier: verif.Identifier,
|
||||||
|
})
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goodSigs = true
|
||||||
|
d.log.Debugf("good signature from %s (%s)", verif.Domain, verif.Identifier)
|
||||||
|
|
||||||
signedFields := make(map[string]struct{}, len(verif.HeaderKeys))
|
signedFields := make(map[string]struct{}, len(verif.HeaderKeys))
|
||||||
for _, field := range verif.HeaderKeys {
|
for _, field := range verif.HeaderKeys {
|
||||||
signedFields[nettextproto.CanonicalMIMEHeaderKey(field)] = struct{}{}
|
signedFields[nettextproto.CanonicalMIMEHeaderKey(field)] = struct{}{}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue