msgpipeline: Fix hang on DMARC fetch error

This commit is contained in:
fox.cpp 2019-12-07 05:37:26 +03:00
parent 50ea068ea7
commit a6dde6345d
No known key found for this signature in database
GPG key ID: E76D97CCEDE90B6C
2 changed files with 7 additions and 4 deletions

View file

@ -23,9 +23,10 @@ type checkRunner struct {
checkedRcptsPerCheck map[module.CheckState]map[string]struct{}
checkedRcptsLock sync.Mutex
resolver dns.Resolver
doDMARC bool
dmarcVerify *dmarc.Verifier
resolver dns.Resolver
doDMARC bool
didDMARCFetch bool
dmarcVerify *dmarc.Verifier
log log.Logger
@ -246,8 +247,9 @@ func (cr *checkRunner) checkBody(checks []module.Check, header textproto.Header,
return err
}
if cr.doDMARC {
if cr.doDMARC && !cr.didDMARCFetch {
cr.dmarcVerify.FetchRecord(header)
cr.didDMARCFetch = true
}
return cr.runAndMergeResults(states, func(s module.CheckState) module.CheckResult {