-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
127 lines (123 loc) · 4.12 KB
/
index.php
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
124
125
126
127
<?php
require_once('sqlite.php');
function h($string) {
return htmlspecialchars($string);
}
$reports = $db->query('
SELECT *
FROM reports
INNER JOIN report_records
ON reports.report_metadata_org_name = report_records.report_metadata_org_name
AND reports.report_metadata_report_id = report_records.report_metadata_report_id
ORDER BY reports.report_metadata_date_range_begin DESC
, reports.report_metadata_org_name
, reports.report_metadata_report_id
, report_records.num
');
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DMARC Reports</title>
<style>
body {
font-size: small;
}
th, td {
border: solid 1px;
padding: 1px 3px;
}
table {
border-collapse: collapse;
white-space: nowrap;
}
</style>
</head>
<body>
<form enctype="multipart/form-data" action="./upload.php" method="post">
<input name="userfile" type="file" />
<input type="submit" value="ファイルを送信" />
</form>
<br />
<table>
<tr>
<th colspan="2" rowspan="2">report_metadata</th>
<th colspan="8" rowspan="2">policy_published</th>
<th colspan="7" rowspan="1">row</th>
<th colspan="3" rowspan="2">identifiers</th>
<th colspan="7" rowspan="1">auth_results</th>
</tr>
<tr>
<th colspan="1" rowspan="2">source_ip</th>
<th colspan="1" rowspan="2">count</th>
<th colspan="5" rowspan="1">policy_evaluated</th>
<th colspan="4" rowspan="1">dkim</th>
<th colspan="3" rowspan="1">spf</th>
</tr>
<tr>
<th>org_name</th>
<th>date_range</th>
<th>domain</th>
<th>adkim</th>
<th>aspf</th>
<th>p</th>
<th>sp</th>
<th>pct</th>
<th>np</th>
<th>fo</th>
<th>disposition</th>
<th>dkim</th>
<th>spf</th>
<th>reason_type</th>
<th>reason_comment</th>
<th>envelope_to</th>
<th>envelope_from</th>
<th>header_from</th>
<th>domain</th>
<th>selector</th>
<th>result</th>
<th>human_result</th>
<th>domain</th>
<th>scope</th>
<th>result</th>
</tr>
<?php
while ($report = $reports->fetchArray()) {
echo '<tr>';
$orgNameTitle = 'email: ' . h($report['report_metadata_email']);
if (!empty($report['report_metadata_extra_contact_info'])) {
$orgNameTitle .= ' extra_contact_info: ' . h($report['report_metadata_extra_contact_info']);
}
echo '<td title="' . $orgNameTitle . '">' . h($report['report_metadata_org_name']) . '</td>';
echo '<td title="report_id: ' . h($report['report_metadata_report_id']) . '">' . date("m-d H:i", $report['report_metadata_date_range_begin']) . ' to ' . date("m-d H:i", $report['report_metadata_date_range_end']) . '</td>';
echo '<td>' . h($report['policy_published_domain']) . '</td>';
echo '<td>' . h($report['policy_published_adkim']) . '</td>';
echo '<td>' . h($report['policy_published_aspf']) . '</td>';
echo '<td>' . h($report['policy_published_p']) . '</td>';
echo '<td>' . h($report['policy_published_sp']) . '</td>';
echo '<td>' . h($report['policy_published_pct']) . '</td>';
echo '<td>' . h($report['policy_published_np']) . '</td>';
echo '<td>' . h($report['policy_published_fo']) . '</td>';
echo '<td title="' . h($report['row_source_ip']) . '">' . h($report['row_souece_hostname']) . '</td>';
echo '<td>' . h($report['row_count']) . '</td>';
echo '<td>' . h($report['row_policy_evaluated_disposition']) . '</td>';
echo '<td>' . h($report['row_policy_evaluated_dkim']) . '</td>';
echo '<td>' . h($report['row_policy_evaluated_spf']) . '</td>';
echo '<td>' . h($report['row_policy_evaluated_reason_type']) . '</td>';
echo '<td>' . h($report['row_policy_evaluated_reason_comment']) . '</td>';
echo '<td>' . h($report['identifiers_envelope_to']) . '</td>';
echo '<td>' . h($report['identifiers_envelope_from']) . '</td>';
echo '<td>' . h($report['identifiers_header_from']) . '</td>';
echo '<td>' . h($report['auth_results_dkim_domain']) . '</td>';
echo '<td>' . h($report['auth_results_dkim_selector']) . '</td>';
echo '<td>' . h($report['auth_results_dkim_result']) . '</td>';
echo '<td>' . h($report['auth_results_dkim_human_result']) . '</td>';
echo '<td>' . h($report['auth_results_spf_domain']) . '</td>';
echo '<td>' . h($report['auth_results_spf_scope']) . '</td>';
echo '<td>' . h($report['auth_results_spf_result']) . '</td>';
echo '</tr>';
}
?>
</table>
</body>
</html>