use mail_auth::{MessageAuthenticator, SpfResult, spf::verify::SpfParameters};
#[tokio::main]
async fn main() {
let authenticator = MessageAuthenticator::new_cloudflare_tls().unwrap();
let result = authenticator
.verify_spf(SpfParameters::verify_ehlo(
"127.0.0.1".parse().unwrap(),
"gmail.com",
"my-local-domain.org",
))
.await;
assert_eq!(result.result(), SpfResult::Fail);
let result = authenticator
.verify_spf(SpfParameters::verify_mail_from(
"::1".parse().unwrap(),
"gmail.com",
"my-local-domain.org",
"sender@gmail.com",
))
.await;
assert_eq!(result.result(), SpfResult::Fail);
}