mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
normalize localparts with unicode nfc when parsing
both when parsing our configs, and for incoming on smtp or in messages. so we properly compare things like é and e+accent as equal, and accept the different encodings of that same address.
This commit is contained in:
@ -125,7 +125,13 @@ func TestReputation(t *testing.T) {
|
||||
rcptToDomain, err := dns.ParseDomain(hm.RcptToDomain)
|
||||
tcheck(t, err, "parse rcptToDomain")
|
||||
rcptToOrgDomain := publicsuffix.Lookup(ctxbg, log.Logger, rcptToDomain)
|
||||
r := store.Recipient{MessageID: hm.ID, Localpart: hm.RcptToLocalpart, Domain: hm.RcptToDomain, OrgDomain: rcptToOrgDomain.Name(), Sent: hm.Received}
|
||||
r := store.Recipient{
|
||||
MessageID: hm.ID,
|
||||
Localpart: hm.RcptToLocalpart.String(),
|
||||
Domain: hm.RcptToDomain,
|
||||
OrgDomain: rcptToOrgDomain.Name(),
|
||||
Sent: hm.Received,
|
||||
}
|
||||
err = tx.Insert(&r)
|
||||
tcheck(t, err, "insert recipient")
|
||||
}
|
||||
|
Reference in New Issue
Block a user