mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 04:14:37 +03:00
do not lookup cname after looking up the txt for mta-sts, and follow cnames for mocks
because the txt would already follow cnames. the additional cname lookup didn't hurt, it just didn't do anything. i probably didn't realize that before looking deeper into dns.
This commit is contained in:
@ -263,7 +263,7 @@ func Get(ctx context.Context, resolver dns.Resolver, domain dns.Domain) (policy
|
||||
policy = &cachedPolicy.Policy
|
||||
nctx, cancel := context.WithTimeout(ctx, 30*time.Second)
|
||||
defer cancel()
|
||||
record, _, _, err := mtasts.LookupRecord(nctx, resolver, domain)
|
||||
record, _, err := mtasts.LookupRecord(nctx, resolver, domain)
|
||||
if err != nil {
|
||||
if !errors.Is(err, mtasts.ErrNoRecord) {
|
||||
// Could be a temporary DNS or configuration error.
|
||||
|
@ -125,7 +125,7 @@ func refreshDomain(ctx context.Context, db *bstore.DB, resolver dns.Resolver, pr
|
||||
return
|
||||
}
|
||||
log.Debug("refreshing mta-sts policy for domain", mlog.Field("domain", d))
|
||||
record, _, _, err := mtasts.LookupRecord(ctx, resolver, d)
|
||||
record, _, err := mtasts.LookupRecord(ctx, resolver, d)
|
||||
if err == nil && record.ID == pr.RecordID {
|
||||
qup := bstore.QueryDB[PolicyRecord](ctx, db)
|
||||
qup.FilterNonzero(PolicyRecord{Domain: pr.Domain, LastUpdate: pr.LastUpdate})
|
||||
|
Reference in New Issue
Block a user