forked from cjeanneret/dmarc-report
-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.j2
86 lines (86 loc) · 2.1 KB
/
template.j2
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="./milligram/milligram.min.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.small {
font-size: 0.7em;
}
table {
counter-reset: item;
list-style-type: decimal;
width: 100%;
}
td.counter {
padding-left: 4px;
}
td.counter:before {
content: counter(item, decimal) '. ';
counter-increment: item;
font-size: 0.7em;
font-color: rgb(204, 204, 204);
}
tr.red td, .fail {
background-color: rgb(255, 128, 128);
font-weight: bold;
}
tr.green td, .pass {
background-color: rgb(153, 255, 153);
}
thead {
display: table;
width: calc(100% - 17px);
}
tbody {
width: calc(100% - 17px);
display: block;
max-height: 90vh;
overflow-y: scroll;
}
th, td {
width: calc(100% / 8);
}
</style>
<title>DMARC report ({{ records|length }} entries)</title>
</head>
<body>
<table>
<thead>
<tr>
<th>IP Address</th>
<th>Count</th>
<th>Domain</th>
<th>SPF</th>
<th>DKIM</th>
<th>Disposition</th>
<th>Reporter</th>
<th>Report date</th>
</tr>
</thead>
<tbody>
{% for line in records %}
{% if line[0] in my_ip %}
{% if line[6] == 'fail' or line[7] == 'fail' %}
<tr class="red">
{% else %}
<tr class="green">
{% endif %}
{% else %}
<tr>
{% endif %}
<td class="counter">{{ line[0] }}<br><span class="small">{{ line[8] }}</span></td>
<td>{{ line[1] }}</td>
<td>{{ line[2] }}</td>
<td class="{{ line[6] }}">{{ line[6] }}</td>
<td class="{{ line[7] }}">{{ line[7] }}</td>
<td>{{ line[9] }}</td>
<td>{{ line[3] }}</td>
<td>{{ line[4] | datetime }} - {{ line[5] | datetime }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>