From db3591e3246c0455cae24160e2cc19a1ccc68b63 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Wed, 19 Jun 2024 19:15:22 +0200 Subject: [PATCH] DNS lookup limit being hit too early during SPF verification (closes #35) --- src/spf/verify.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/spf/verify.rs b/src/spf/verify.rs index 22842b8..63152d3 100644 --- a/src/spf/verify.rs +++ b/src/spf/verify.rs @@ -183,8 +183,12 @@ impl Resolver { .await { Ok(records) => { - for exchange in records.iter().flat_map(|mx| mx.exchanges.iter()) { - if !lookup_limit.can_lookup() { + for (mx_num, exchange) in records + .iter() + .flat_map(|mx| mx.exchanges.iter()) + .enumerate() + { + if mx_num > 9 { return output .with_result(SpfResult::PermError) .with_report(&spf_record);