diff options
-rw-r--r-- | examples/dmarc_report_example.xml | 50 | ||||
-rw-r--r-- | src/data_structures.rs | 35 |
2 files changed, 85 insertions, 0 deletions
diff --git a/examples/dmarc_report_example.xml b/examples/dmarc_report_example.xml new file mode 100644 index 0000000..d560d85 --- /dev/null +++ b/examples/dmarc_report_example.xml @@ -0,0 +1,50 @@ +<?xml version="1.0"?>
+<feedback xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <version>1.0</version>
+ <report_metadata>
+ <org_name>Enterprise Outlook</org_name>
+ <email>dmarcreport@microsoft.com</email>
+ <report_id>3374fb5148ba40c1a5cf8e3d36f34a34</report_id>
+ <date_range>
+ <begin>1707436800</begin>
+ <end>1707523200</end>
+ </date_range>
+ </report_metadata>
+ <policy_published>
+ <domain>boitalett.re</domain>
+ <adkim>s</adkim>
+ <aspf>s</aspf>
+ <p>reject</p>
+ <sp>reject</sp>
+ <pct>100</pct>
+ <fo>0</fo>
+ </policy_published>
+ <record>
+ <row>
+ <source_ip>195.154.102.43</source_ip>
+ <count>1</count>
+ <policy_evaluated>
+ <disposition>none</disposition>
+ <dkim>pass</dkim>
+ <spf>pass</spf>
+ </policy_evaluated>
+ </row>
+ <identifiers>
+ <envelope_to>babilou.com</envelope_to>
+ <envelope_from>boitalett.re</envelope_from>
+ <header_from>boitalett.re</header_from>
+ </identifiers>
+ <auth_results>
+ <dkim>
+ <domain>boitalett.re</domain>
+ <selector>2023101501</selector>
+ <result>pass</result>
+ </dkim>
+ <spf>
+ <domain>boitalett.re</domain>
+ <scope>mfrom</scope>
+ <result>pass</result>
+ </spf>
+ </auth_results>
+ </record>
+</feedback>
\ No newline at end of file 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 +} |