decon-spf 0.3.3

This is a simple tool that allows you to deconstruct an existing SPF record that might be retreived in a normal DNS TXT lookup. With version 0.2.0 you can now also construct a new Spf record.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod parse {

    use crate::SpfBuilder;

    #[test]
    fn test_include() {
        let input = "v=spf1 include:_spf.example.com ~all";

        let spf: SpfBuilder<_> = input.parse().unwrap();
        assert!(spf.includes().is_some());
        assert_eq!(spf.includes().unwrap()[0].qualifier().is_pass(), true);
        assert_eq!(spf.includes().unwrap()[0].raw(), "_spf.example.com");
        assert_eq!(
            spf.includes().unwrap()[0].to_string(),
            "include:_spf.example.com"
        );
    }
}