summaryrefslogtreecommitdiffstats
path: root/templates/feedback
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2017-04-12 11:44:39 +0200
committerTomasz Kramkowski <tk@the-tk.com>2017-04-12 11:44:39 +0200
commitc2b8235b0e3506d0d36ac626c5df84edd7c58740 (patch)
treee251e4f1ec50494c41c8cbd7c922a18b33528719 /templates/feedback
parent46494949fbd551e40a082421dc9e86be084a00d8 (diff)
downloaddmarcpipe-c2b8235b0e3506d0d36ac626c5df84edd7c58740.tar.gz
dmarcpipe-c2b8235b0e3506d0d36ac626c5df84edd7c58740.tar.xz
dmarcpipe-c2b8235b0e3506d0d36ac626c5df84edd7c58740.zip
dmarcstats
Diffstat (limited to 'templates/feedback')
-rw-r--r--templates/feedback/export.xml72
-rw-r--r--templates/feedback/index.html49
-rw-r--r--templates/feedback/report.html113
3 files changed, 234 insertions, 0 deletions
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 @@
+<?xml version="1.0"?>
+<feedback>
+ <report_metadata>
+ <org_name>{{ feedback.rm_org_name }}</org_name>
+ <email>{{ feedback.rm_email }}</email>
+ {% if feedback.rm_extra_contact_info %}
+ <extra_contact_info>{{ feedback.rm_extra_contact_info }}</extra_contact_info>
+ {% endif %}
+ <report_id>{{ feedback.rm_report_id }}</report_id>
+ <date_range>
+ <begin>{{ feedback.rm_date_begin }}</begin>
+ <end>{{ feedback.rm_date_end }}</end>
+ </date_range>
+ </report_metadata>
+ <policy_published>
+ <domain>{{ feedback.pp_domain }}</domain>
+ <adkim>{{ feedback.pp_adkim }}</adkim>
+ <aspf>{{ feedback.pp_aspf }}</aspf>
+ <p>{{ feedback.pp_p }}</p>
+ <sp>{{ feedback.pp_sp }}</sp>
+ <pct>{{ feedback.pp_pct }}</pct>
+ </policy_published>
+ {% for r in records %}
+ <record>
+ <row>
+ <source_ip>{{ r.row_source_ip }}</source_ip>
+ <count>{{ r.row_count }}</count>
+ {% if r.row_pol_disposition and r.row_pol_dkim and r.row_pol_spf %}
+ <policy_evaluated>
+ <disposition>{{ r.row_pol_disposition }}</disposition>
+ <dkim>{{ r.row_pol_dkim }}</dkim>
+ <spf>{{ r.row_pol_spf }}</spf>
+ {% for rs in reasons if rs.recordid == r.recordid %}
+ <reason>
+ <type>{{ rs.type }}</type>
+ {% if rs.comment %}
+ <comment>{{ rs.comment }}</comment>
+ {% endif %}
+ </reason>
+ {% endfor %}
+ </policy_evaluated>
+ {% endif %}
+ </row>
+ <identifiers>
+ {% if r.ids_envelope_to %}
+ <envelope_to>{{ r.ids_envelope_to }}</envelope_to>
+ {% endif %}
+ <header_from>{{ r.ids_header_from }}</header_from>
+ </identifiers>
+ <auth_results>
+ {% for d in resdkim if d.recordid == r.recordid %}
+ <dkim>
+ <domain>{{ d.domain }}</domain>
+ {% if d.selector %}
+ <selector>{{ d.selector }}</selector>
+ {% endif %}
+ <result>{{ d.result }}</result>
+ {% if d.human_result %}
+ <human_result>{{ d.human_result }}</human_result>
+ {% endif %}
+ </dkim>
+ {% endfor %}
+ {% for s in resspf if s.recordid == r.recordid %}
+ <spf>
+ <domain>{{ s.domain }}</domain>
+ <result>{{ s.result }}</result>
+ </spf>
+ {% endfor %}
+ </auth_results>
+ </record>
+ {% endfor %}
+</feedback>
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 %}
+<ol class="breadcrumb">
+ <li><a href="{{ url_for('index') }}">Index</a></li>
+ <li class="active">Feedback</li>
+</ol>
+<h1>Feedback</h1>
+<table class="table table-condensed">
+ <tr>
+ <th>{{ orderhdr('Organisation Name', 'feedback', 'rm_org_name', order)|safe }}</th>
+ <th>{{ orderhdr('Date Begin', 'feedback', 'rm_date_begin', order)|safe }}</th>
+ <th>{{ orderhdr('Date End', 'feedback', 'rm_date_end', order)|safe }}</th>
+ <th>{{ orderhdr('Messages', 'feedback', 'nemails', order)|safe }}</th>
+ <th>None</th>
+ <th>Pass</th>
+ <th>DKIM</th>
+ <th>SPF</th>
+ <th></th>
+ </tr>
+ {% for item in feedback %}
+ <a href="{{ url_for('report', feedbackid=item.feedbackid) }}">
+ <tr>
+ <td>{{ item.rm_org_name }}</td>
+ <td><time>{{ item.rm_date_begin|isotime }}</time></td>
+ <td><time>{{ item.rm_date_end|isotime }}</time></td>
+ <td>{{ item.nemails }}</td>
+ <td class="{{ item.pass_none|pctclass(item.nemails) }}">
+ {{ (item.pass_none / item.nemails * 100)|round|int }}%
+ </td>
+ <td class="{{ item.pass_dmarc|pctclass(item.nemails) }}">
+ {{ (item.pass_dmarc / item.nemails * 100)|round|int }}%
+ </td>
+ <td class="{{ item.pass_dkim|pctclass(item.nemails) }}">
+ {{ (item.pass_dkim / item.nemails * 100)|round|int }}%
+ </td>
+ <td class="{{ item.pass_spf|pctclass(item.nemails) }}">
+ {{ (item.pass_spf / item.nemails * 100)|round|int }}%
+ </td>
+ <td>
+ <a class="btn btn-xs" href="{{ url_for('report', feedbackid=item.feedbackid) }}">
+ Report
+ </a>
+ </td>
+ </tr>
+ </a>
+ {% endfor %}
+</table>
+{% 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 %}
+<ol class="breadcrumb">
+ <li><a href="{{ url_for('index') }}">Index</a></li>
+ <li><a href="{{ url_for('feedback') }}">Feedback</a></li>
+ <li class="active">Report</li>
+</ol>
+<h1>Report</h1>
+<div class="row">
+ <div class="col-md-7">
+ <h2>Report Metadata</h1>
+ <dl class="dl-horizontal">
+ <dt>Organisation Name</dt><dd>{{ feedback.rm_org_name }}</dd>
+ <dt>Email</dt><dd>{{ feedback.rm_email }}</dd>
+ <dt>Extra Contact Info</dt><dd>{{ feedback.rm_extra_contact_info }}</dd>
+ <dt>Report ID</dt><dd>{{ feedback.rm_report_id }}</dd>
+ <dt>Date Range</dt><dd>
+ <time>{{ feedback.rm_date_begin|isotime }}</time>
+ to
+ <time>{{ feedback.rm_date_end|isotime }}</time>
+ </dd>
+ </dl>
+ </div>
+ <div class="col-md-5">
+ <h2>Policy Published</h1>
+ <dl class="dl-horizontal">
+ <dt>Domain</dt><dd>{{ feedback.pp_domain }}</dd>
+ <dt>DKIM Alignment</dt><dd>{{ feedback.pp_adkim|alignment }}</dd>
+ <dt>SPF Alignment</dt><dd>{{ feedback.pp_aspf|alignment }}</dd>
+ <dt>Policy</dt><dd>{{ feedback.pp_p|capitalize }}</dd>
+ <dt>Subdomain Policy</dt><dd>{{ feedback.pp_sp|capitalize }}</dd>
+ </dl>
+ </div>
+ <div class="col-md-6">
+ <h2>Statistics</h2>
+ <table class="table">
+ <tr>
+ <th></th>
+ <th>Total</th>
+ <th>%</th>
+ </tr>
+ <tr>
+ <td>Messages</td>
+ <td>{{ total.records }}</td>
+ <td></td>
+ </tr>
+ <tr class="{{ total.none|pctclass(total.records) }}">
+ <td>Disposition None</td>
+ <td>{{ total.none }}</td>
+ <td>{{ (total.none / total.records * 100)|round|int }}%</td>
+ </tr>
+ <tr class="{{ total.dmarc|pctclass(total.records) }}">
+ <td>DKIM or SPF Pass</td>
+ <td>{{ total.dmarc }}</td>
+ <td>{{ (total.dmarc / total.records * 100)|round|int }}%</td>
+ </tr>
+ <tr class="{{ total.dkim|pctclass(total.records) }}">
+ <td>DKIM Pass</td>
+ <td>{{ total.dkim }}</td>
+ <td>{{ (total.dkim / total.records * 100)|round|int }}%</td>
+ </tr>
+ <tr class="{{ total.spf|pctclass(total.records) }}">
+ <td>SPF Pass</td>
+ <td>{{ total.spf }}</td>
+ <td>{{ (total.spf / total.records * 100)|round|int }}%</td>
+ </tr>
+ </table>
+ </div>
+ <div class="col-md-6">
+ <h2>Utilities</h2>
+ <ul>
+ <li>XML Export:
+ <a class="btn btn-default" href="{{ url_for('export', feedbackid=feedback.feedbackid) }}">View</a>
+ <a class="btn btn-default" href="{{ url_for('export', feedbackid=feedback.feedbackid) }}" download="{{ feedback.rm_report_id }}">Download</a>
+ </li>
+ </ul>
+ </div>
+</div>
+<div class="row">
+ <div class="col-md-12">
+ <h2>Records</h2>
+ <table class="table table-condensed">
+ <tr>
+ <th>Source</th>
+ <th>Count</th>
+ <th>Disposition</th>
+ <th>DKIM</th>
+ <th>SPF</th>
+ <th>Envelope To</th>
+ <th>Header From</th>
+ <th></th>
+ </tr>
+ {% for item in records %}
+ <tr>
+ <td>{{ item['row_source_ip']|fqdn }}</td>
+ <td>{{ item['row_count'] }}</td>
+ <td>{{ item['row_pol_disposition'] }}</td>
+ <td class="{{ item['row_pol_dkim']|tblclass }}">{{ item['row_pol_dkim'] }}</td>
+ <td class="{{ item['row_pol_spf']|tblclass }}">{{ item['row_pol_spf'] }}</td>
+ <td>{{ item['ids_envelope_to'] }}</td>
+ <td>{{ item['ids_header_from'] }}</td>
+ <td>
+ <a class="btn btn-xs" href="{{ url_for('record', recordid=item['recordid']) }}">
+ Record
+ </a>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endblock %}
+ </div>
+</div>