From 13e1af6641cdfc8c8427b5c2a81f8b79aef9e26b Mon Sep 17 00:00:00 2001 From: shukuru Date: Sun, 18 Feb 2024 14:50:55 +0100 Subject: Add DMARC report data structure code --- src/data_structures.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/data_structures.rs (limited to 'src/data_structures.rs') diff --git a/src/data_structures.rs b/src/data_structures.rs new file mode 100644 index 0000000..a90b7b0 --- /dev/null +++ b/src/data_structures.rs @@ -0,0 +1,35 @@ +enum DMARCPolicy { + None, + Quarantine, + Reject +} + +enum DMARCAlignment { + Relaxed, + Strict +} + +enum DMARCFailureOption { + AlignedPassFailure, + OtherAlignedPassFailure, + SignatureAlignmentFailure, + SPFFailure +} + +struct DMARCRecord { + domain: String, + adkim: DMARCAlignment, + aspf: DMARCAlignment, + policy: DMARCPolicy, + subdomain_policy: DMARCPolicy, + percentage: u64, + failure_opt: DMARCFailureOption +} + +pub struct DMARCReport { + id: String, + org: String, + record: DMARCRecord, + dkim_pass: bool, + spf_pass: bool +} -- cgit v1.2.3