mod common; pub use common::*; use indymilter_test::*; use spf_milter::*; #[tokio::test] #[ignore = "depends on live DNS records"] async fn live() { let opts = configure_logging(CliOptions::builder()) .config_file(to_config_file_name(file!())) .build(); let config = Config::read(opts).await.unwrap(); let milter = SpfMilter::spawn(config).await.unwrap(); let mut conn = TestConnection::open(milter.addr()).await.unwrap(); conn.macros(MacroStage::Connect, [("j", "mail.example.org")]).await.unwrap(); let status = conn.connect("client.gluet.ch", [46, 231, 204, 85]).await.unwrap(); assert_eq!(status, Status::Continue); let status = conn.helo("mail.gluet.ch").await.unwrap(); assert_eq!(status, Status::Continue); let status = conn.mail([""]).await.unwrap(); assert_eq!(status, Status::Continue); conn.macros(MacroStage::Data, [("i", "1234567ABC")]).await.unwrap(); let (actions, status) = conn.eom().await.unwrap(); assert_eq!(status, Status::Continue); assert!(actions.has_insert_header(0, "Received-SPF", any())); conn.close().await.unwrap(); milter.shutdown().await.unwrap(); }