Skip to content

Commit 3e69edb

Browse files
author
Andy
committed
Version 0.0.1 - the bare minimum
1 parent c42682a commit 3e69edb

File tree

7 files changed

+1083
-1
lines changed

7 files changed

+1083
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Cargo.lock
88

99
# These are backup files generated by rustfmt
1010
**/*.rs.bk
11+
12+
release/

Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "tinydmarc"
3+
version = "0.0.1"
4+
authors = ["Andy <github@monkeysplayingpingpong.co.uk>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
chrono = "0.4"
11+
clap = "2"
12+
log = "0.4"
13+
roxmltree = "0.13"
14+
simple_logger = "1.10"

README.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,83 @@
11
# tinydmarc
2-
A tiny "functionally minimalist" DMARC aggregate report summarizer
2+
A tiny "functionally minimalist" DMARC aggregate report summarizer.
3+
4+
## What is it?
5+
6+
`tinydmarc` is a small, simple CLI that can read in a set of DMARC Aggregate Report XML files and generates a report, broken down by week and receiving domain, with the number
7+
of emails "rejected" and "not rejected" by each domain in that week.
8+
9+
## What isn't it?
10+
11+
This is in no way a "feature rich" tool for processing DMARC reports!
12+
13+
- It does not handle many error cases
14+
- It does not handle DMARC Forensic reports
15+
- It does not draw any charts
16+
- It does not handle non-standard Aggregate Report files
17+
- It does not retrieve the report files from an email account
18+
- It does not handle time zones
19+
20+
`tinydmarc` does the bare minimum of what I want, and was mostly an exercise in learning the basics of Rust. If you want an awesome, fully functional DMARC solution, then
21+
check out [parsedmarc](https://domainaware.github.io/parsedmarc/#). If you just want to check if your DMARC reports show any rejected messages recently then maybe `tinydmarc`
22+
is for you.
23+
24+
## What does it do?
25+
26+
`tinydmarc` takes as input a directory containing a set of DMARC Aggregate Reports. It reads in all of the reports, then assigns them to a week-long time bucket running from
27+
Sunday to Sunday, using the value from `feedback.report_metadata.date_range.begin`.
28+
29+
It then loops through each time bucket and processes all of the reports in that bucket. For each report, it iterates through each `feedback.record` and counts how many messages
30+
have `record.row.policy_evaluated.disposition` equal to "none" (counting as a "good" message) and how many do not (counting as a "bad" message). It then generates a report with
31+
a weekly breakdown of how many messages each receiving domain reported as "good" and "bad".
32+
33+
The report can be printed to `STDOUT` or written to a file, and the report format can be one of `txt`, `html` and `JSON`.
34+
35+
## How do I use it?
36+
37+
```
38+
$ tinydmarc --help
39+
Tiny DMARC Report Generator 0.0.1
40+
Scans all DMARC XML reports in a folder and generates a simple HTML report
41+
42+
USAGE:
43+
tinydmarc [FLAGS] [OPTIONS] --inputDir <INPUTDIR>
44+
45+
FLAGS:
46+
-h, --help Prints help information
47+
-v Sets the level of verbosity (-vvv is trace)
48+
-V, --version Prints version information
49+
50+
OPTIONS:
51+
-o, --outputFormat <FORMAT> Sets the output file format [default: txt] [possible values: html, txt, json]
52+
-i, --inputDir <INPUTDIR> Sets the directory containing the DMARC reports
53+
-f, --outputFile <OUTPUTFILE> Sets the output file to write to
54+
```
55+
56+
### Print out a summary to STDOUT
57+
58+
```
59+
$> tinydmarc --inputDir path/to/dmarc/reports/
60+
DMARC REPORT GENERATED AT 2020-12-14T23:02:36.546142100+00:00
61+
===
62+
Date: Sun 22 November - Sat 28 November
63+
Domain: "google.com" - Good: 6 - Bad: 0
64+
---
65+
Date: Sun 29 November - Sat 5 December
66+
Domain: "Yahoo! Inc." - Good: 6 - Bad: 0
67+
Domain: "google.com" - Good: 40 - Bad: 0
68+
---
69+
```
70+
71+
### Write an HTML report to a file
72+
73+
```
74+
$> tinydmarc --inputDir path/to/dmarc/reports/ --outputFile path/to/report.html -o html
75+
```
76+
77+
which may produce:
78+
79+
![html report of email success](./html-report.png)
80+
81+
## License
82+
83+
Do what you want with it!

html-report.png

17 KB
Loading

0 commit comments

Comments
 (0)