From c2b8235b0e3506d0d36ac626c5df84edd7c58740 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Wed, 12 Apr 2017 11:44:39 +0200 Subject: dmarcstats --- templates/feedback/export.xml | 72 ++++++++++++++++++++++++++ templates/feedback/index.html | 49 ++++++++++++++++++ templates/feedback/report.html | 113 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 templates/feedback/export.xml create mode 100644 templates/feedback/index.html create mode 100644 templates/feedback/report.html (limited to 'templates/feedback') diff --git a/templates/feedback/export.xml b/templates/feedback/export.xml new file mode 100644 index 0000000..ad556d2 --- /dev/null +++ b/templates/feedback/export.xml @@ -0,0 +1,72 @@ + + + + {{ feedback.rm_org_name }} + {{ feedback.rm_email }} + {% if feedback.rm_extra_contact_info %} + {{ feedback.rm_extra_contact_info }} + {% endif %} + {{ feedback.rm_report_id }} + + {{ feedback.rm_date_begin }} + {{ feedback.rm_date_end }} + + + + {{ feedback.pp_domain }} + {{ feedback.pp_adkim }} + {{ feedback.pp_aspf }} +

{{ feedback.pp_p }}

+ {{ feedback.pp_sp }} + {{ feedback.pp_pct }} +
+ {% for r in records %} + + + {{ r.row_source_ip }} + {{ r.row_count }} + {% if r.row_pol_disposition and r.row_pol_dkim and r.row_pol_spf %} + + {{ r.row_pol_disposition }} + {{ r.row_pol_dkim }} + {{ r.row_pol_spf }} + {% for rs in reasons if rs.recordid == r.recordid %} + + {{ rs.type }} + {% if rs.comment %} + {{ rs.comment }} + {% endif %} + + {% endfor %} + + {% endif %} + + + {% if r.ids_envelope_to %} + {{ r.ids_envelope_to }} + {% endif %} + {{ r.ids_header_from }} + + + {% for d in resdkim if d.recordid == r.recordid %} + + {{ d.domain }} + {% if d.selector %} + {{ d.selector }} + {% endif %} + {{ d.result }} + {% if d.human_result %} + {{ d.human_result }} + {% endif %} + + {% endfor %} + {% for s in resspf if s.recordid == r.recordid %} + + {{ s.domain }} + {{ s.result }} + + {% endfor %} + + + {% endfor %} +
diff --git a/templates/feedback/index.html b/templates/feedback/index.html new file mode 100644 index 0000000..617c758 --- /dev/null +++ b/templates/feedback/index.html @@ -0,0 +1,49 @@ +{% extends "layout.html" %} +{% block title %}Feedback{% endblock %} +{% block content %} + +

Feedback

+ + + + + + + + + + + + + {% for item in feedback %} + + + + + + + + + + + + + + {% endfor %} +
{{ orderhdr('Organisation Name', 'feedback', 'rm_org_name', order)|safe }}{{ orderhdr('Date Begin', 'feedback', 'rm_date_begin', order)|safe }}{{ orderhdr('Date End', 'feedback', 'rm_date_end', order)|safe }}{{ orderhdr('Messages', 'feedback', 'nemails', order)|safe }}NonePassDKIMSPF
{{ item.rm_org_name }}{{ item.nemails }} + {{ (item.pass_none / item.nemails * 100)|round|int }}% + + {{ (item.pass_dmarc / item.nemails * 100)|round|int }}% + + {{ (item.pass_dkim / item.nemails * 100)|round|int }}% + + {{ (item.pass_spf / item.nemails * 100)|round|int }}% + + + Report + +
+{% endblock %} diff --git a/templates/feedback/report.html b/templates/feedback/report.html new file mode 100644 index 0000000..141c823 --- /dev/null +++ b/templates/feedback/report.html @@ -0,0 +1,113 @@ +{% extends "layout.html" %} +{% block title %}Report{% endblock %} +{% block content %} + +

Report

+
+
+

Report Metadata

+
+
Organisation Name
{{ feedback.rm_org_name }}
+
Email
{{ feedback.rm_email }}
+
Extra Contact Info
{{ feedback.rm_extra_contact_info }}
+
Report ID
{{ feedback.rm_report_id }}
+
Date Range
+ + to + +
+
+
+
+

Policy Published

+
+
Domain
{{ feedback.pp_domain }}
+
DKIM Alignment
{{ feedback.pp_adkim|alignment }}
+
SPF Alignment
{{ feedback.pp_aspf|alignment }}
+
Policy
{{ feedback.pp_p|capitalize }}
+
Subdomain Policy
{{ feedback.pp_sp|capitalize }}
+
+
+
+

Statistics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total%
Messages{{ total.records }}
Disposition None{{ total.none }}{{ (total.none / total.records * 100)|round|int }}%
DKIM or SPF Pass{{ total.dmarc }}{{ (total.dmarc / total.records * 100)|round|int }}%
DKIM Pass{{ total.dkim }}{{ (total.dkim / total.records * 100)|round|int }}%
SPF Pass{{ total.spf }}{{ (total.spf / total.records * 100)|round|int }}%
+
+
+

Utilities

+ +
+
+
+
+

Records

+ + + + + + + + + + + + {% for item in records %} + + + + + + + + + + + {% endfor %} +
SourceCountDispositionDKIMSPFEnvelope ToHeader From
{{ item['row_source_ip']|fqdn }}{{ item['row_count'] }}{{ item['row_pol_disposition'] }}{{ item['row_pol_dkim'] }}{{ item['row_pol_spf'] }}{{ item['ids_envelope_to'] }}{{ item['ids_header_from'] }} + + Record + +
+ {% endblock %} +
+
-- cgit v1.2.3-54-g00ecf