mirror of
https://github.com/mjl-/mox.git
synced 2025-07-03 09:48:14 +03:00
fix not adding duplicate domains to the list of "verified dkim domains" for incoming messages
This commit is contained in:
parent
cb1b133e28
commit
a5006a9090
@ -2124,16 +2124,16 @@ func (c *conn) deliver(ctx context.Context, recvHdrFor func(string) string, msgW
|
|||||||
// Prepare for analyzing content, calculating reputation.
|
// Prepare for analyzing content, calculating reputation.
|
||||||
ipmasked1, ipmasked2, ipmasked3 := ipmasked(c.remoteIP)
|
ipmasked1, ipmasked2, ipmasked3 := ipmasked(c.remoteIP)
|
||||||
var verifiedDKIMDomains []string
|
var verifiedDKIMDomains []string
|
||||||
|
dkimSeen := map[string]bool{}
|
||||||
for _, r := range dkimResults {
|
for _, r := range dkimResults {
|
||||||
// A message can have multiple signatures for the same identity. For example when
|
// A message can have multiple signatures for the same identity. For example when
|
||||||
// signing the message multiple times with different algorithms (rsa and ed25519).
|
// signing the message multiple times with different algorithms (rsa and ed25519).
|
||||||
seen := map[string]bool{}
|
|
||||||
if r.Status != dkim.StatusPass {
|
if r.Status != dkim.StatusPass {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
d := r.Sig.Domain.Name()
|
d := r.Sig.Domain.Name()
|
||||||
if !seen[d] {
|
if !dkimSeen[d] {
|
||||||
seen[d] = true
|
dkimSeen[d] = true
|
||||||
verifiedDKIMDomains = append(verifiedDKIMDomains, d)
|
verifiedDKIMDomains = append(verifiedDKIMDomains, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user