-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.py
123 lines (117 loc) · 4.09 KB
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
"""
<Name>
data.py
<Author>
Lukas Puehringer <[email protected]>
<Started>
May, 2018
<Copyright>
See LICENSE for licensing information.
<Purpose>
Python dictionary containing sample DMARC aggregate report data.
"""
sample_report = {
# Report generator metadata
"report_metadata": {
"org_name": "reporter.org",
"org_email": "[email protected]",
"extra_contact_info": "www.reporter.org",
# "<report receiver domain>:<non-leap seconds since epoch>"
"report_id": "reportee.org:1514847601",
# The time range in UTC covered by messages in this report,
# specified in seconds since epoch
"date_range": {
"begin": 1514761200,
"end": 1514847600
},
# Optional list of error strings
"errors": [],
},
"policy_published": {
# The domain at which the DMARC record was found, i.e. report receiver
"domain": "reportee.org",
# Optional alignment modes for DKIM and SPF,
# relaxed ("r") or strict ("s")
"adkim": "r",
"aspf": "r",
# Policy actions applied to messages in this report,
# "none", "quarantine" or "reject"
# Policy applied to messages from report receiver domain
"p": "none",
# Policy applied to messages from report receiver subdomains
"sp": "none",
# The percent of messages to which policy applies
"pct": 100
},
# List of all the authentication results that were evaluated by the
# mail receiving system, i.e. report sender, for the given set of messages
"records" : [
{
# NOTE: There is only one row per record (no idea why they call it row)
"row": {
# The connecting IP (v4 or v6)
"source_ip": "8.8.8.8",
# The number of matching messages
"count": 42,
# Taking into account everything else in the record,
# the results of applying DMARC
"policy_evaluated": {
# The DMARC disposition applying to matching messages, i.e. the
# policy specified p and sp, applied according to the DMARC
# verification result, i.e. one of "none", "quarantine", "reject"
"disposition": "none",
# The DMARC-aligned DKIM and SPF authentication results,
# "pass", "fail"
"dkim": "pass",
"spf": "fail",
# Optional list of reasons that may affect DMARC disposition
# or execution thereof
"reasons": [
{
# One of "forwarded", "sampled_out", "trusted_forwarder",
# "mailing_list", "local_policy", "other"
"type": "other",
# Optional comment
"comment": "No reason"
}
]
}
},
"identifiers": {
# Optional envelope recipient domain
"envelope_to": "reporter.org",
# The RFC5322.From domain
"header_from": "reportee.org"
},
"auth_results": {
# Optional list of DKIM authentication results
# NOTE: One per DKIM signature in the matching emails
"dkim": [
{
# The "d=" parameter in the DKIM signature
"domain": "reportee.org",
# Optionally the "s=" parameter in the DKIM signature
"selector": "abc",
# The DKIM verification result, one of "none", "pass", "fail",
# "policy", "neutral", "temperror", "permerror"
"result": "pass",
# Optional extra information (e.g., from Authentication-Results)
"human_result": "pass"
}
],
# List of SPF verification results (at least one)
"spf": [
{
# The checked domain
"domain": "reprotee.org",
# The scope of the checked domain, "helo" or "mfrom"
"scope": "helo",
# SPF result, one of none, neutral, pass, fail, softfail,
# temperror, permerror
"result": "neutral"
}
]
}
}
]
}