Commit
Author: mdecimus [mauro@stalw.art]
Hash: db3591e3246c0455cae24160e2cc19a1ccc68b63
Timestamp: Wed, 19 Jun 2024 17:15:22 +0000 (4 months ago)

+6 -2 +/-1 browse
DNS lookup limit being hit too early during SPF verification (closes #35)
1diff --git a/src/spf/verify.rs b/src/spf/verify.rs
2index 22842b8..63152d3 100644
3--- a/src/spf/verify.rs
4+++ b/src/spf/verify.rs
5 @@ -183,8 +183,12 @@ impl Resolver {
6 .await
7 {
8 Ok(records) => {
9- for exchange in records.iter().flat_map(|mx| mx.exchanges.iter()) {
10- if !lookup_limit.can_lookup() {
11+ for (mx_num, exchange) in records
12+ .iter()
13+ .flat_map(|mx| mx.exchanges.iter())
14+ .enumerate()
15+ {
16+ if mx_num > 9 {
17 return output
18 .with_result(SpfResult::PermError)
19 .with_report(&spf_record);