mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +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
1 changed files with 3 additions and 3 deletions
|
@ -2124,16 +2124,16 @@ func (c *conn) deliver(ctx context.Context, recvHdrFor func(string) string, msgW
|
|||
// Prepare for analyzing content, calculating reputation.
|
||||
ipmasked1, ipmasked2, ipmasked3 := ipmasked(c.remoteIP)
|
||||
var verifiedDKIMDomains []string
|
||||
dkimSeen := map[string]bool{}
|
||||
for _, r := range dkimResults {
|
||||
// A message can have multiple signatures for the same identity. For example when
|
||||
// signing the message multiple times with different algorithms (rsa and ed25519).
|
||||
seen := map[string]bool{}
|
||||
if r.Status != dkim.StatusPass {
|
||||
continue
|
||||
}
|
||||
d := r.Sig.Domain.Name()
|
||||
if !seen[d] {
|
||||
seen[d] = true
|
||||
if !dkimSeen[d] {
|
||||
dkimSeen[d] = true
|
||||
verifiedDKIMDomains = append(verifiedDKIMDomains, d)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue