mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-09 03:52:13 +00:00
spf: add basic support for the exists mechanism
This commit is contained in:
committed by
Wez Furlong
parent
487a45c9ff
commit
5853970c0f
@@ -234,7 +234,18 @@ impl Directive {
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => todo!("evaluate directive {self:?}"),
|
||||
Mechanism::Exists { domain } => {
|
||||
let domain = cx.domain(Some(domain))?;
|
||||
match resolver.lookup_ip(&domain).await {
|
||||
Ok(ips) => ips.iter().any(|ip| ip.is_ipv4()),
|
||||
Err(err) => {
|
||||
return Err(SpfResult {
|
||||
disposition: SpfDisposition::TempError,
|
||||
context: format!("error looking up IP for {domain}: {err}"),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Ok(match matched {
|
||||
|
||||
Reference in New Issue
Block a user