mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
give delivering to mx targets with underscores in name a chance of succeeding
the underscores aren't valid, but have been seen in the wild, so we have a workaround for them. there are limitations, it won't work with idna domains. and if the domain has other policies, like mta-sts, the mx host won't pass either. after report from richard g about delivery issue, thanks!
This commit is contained in:
@ -444,7 +444,8 @@ func evaluate(ctx context.Context, record *Record, resolver dns.Resolver, args A
|
||||
if i >= 10 {
|
||||
return StatusPermerror, d.MechanismString(), "", rauthentic, ErrTooManyDNSRequests
|
||||
}
|
||||
mxd, err := dns.ParseDomain(strings.TrimSuffix(mx.Host, "."))
|
||||
// Parsing lax (unless in pedantic mode) for MX targets with underscores as seen in the wild.
|
||||
mxd, err := dns.ParseDomainLax(strings.TrimSuffix(mx.Host, "."))
|
||||
if err != nil {
|
||||
return StatusPermerror, d.MechanismString(), "", rauthentic, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user