From b9442e7d3d411b18cf3487b9af592add5e1d71c3 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 8 Aug 2020 12:54:12 +0100 Subject: [PATCH] mutt: convert dmarc reports to html and display in browser Currently only supports doing this from the attachement view. This is ok for now. --- mutt/dmarc.xsl | 327 +++++++++++++++++++++++++++++++++++++++++++++++++ mutt/mailcap | 7 ++ 2 files changed, 334 insertions(+) create mode 100644 mutt/dmarc.xsl diff --git a/mutt/dmarc.xsl b/mutt/dmarc.xsl new file mode 100644 index 0000000..4c16c50 --- /dev/null +++ b/mutt/dmarc.xsl @@ -0,0 +1,327 @@ + + + + + + http://network-tools.com/default.asp?prog=lookup&host= + + + + + + Feedback from + + + + + <xsl:value-of select="$title"/> + + + + +

+ +

+

+ +
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Relaying IP + + message count + + reason and disposition + + From header +
+ (opt. envelope) +
+ SPF + + DKIM + + 2nd DKIM + + 3rd DKIM +
+

+ Legend
+ disposition:
+ quarantine, + reject.
+ spf: + pass, + fail, + softfail, + temperror or permerror.
+ dkim: + pass, + fail, + policy. +

+ + +
+ + Domain: + + ; + DKIM: + + ; + SPF: + + ; + policy published: + + + + + + + + + + + + + relaxed + + + strict + + + {$alignment} + + + + + Id: + + ; + begin: + + + + ; + end: + + + + + +
+ Error: +
+ + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + reject + + + quarantine + + + normal + + + + + + + +
+
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + pass + + + fail + + + error + + + dkimpolicy + + + softfail + + + normal + + + + + + + + +
+ +
+ + +
+ + + + +
+ +
+ + +
+
+ diff --git a/mutt/mailcap b/mutt/mailcap index 6eb7391..57f8247 100644 --- a/mutt/mailcap +++ b/mutt/mailcap @@ -1,5 +1,12 @@ text/html; $XDG_CONFIG_HOME/mutt/mutt_bgrun qutebrowser %s; test=test -n "$DISPLAY"; nametemplate=%s.html text/html; w3m -I %{charset} -dump %s -T text/html -cols "$COLUMNS" -o display_link_number=1; copiousoutput; nametemplate=%s.html text/calendar; $XDG_CONFIG_HOME/mutt/ical2txt; copiousoutput +# generate html from dmarc report, testing against *rmz.io* because all other tests were to difficult +application/gzip; zcat | xsltproc $XDG_CONFIG_HOME/mutt/dmarc.xsl - > /tmp/dmarc.html && qutebrowser /tmp/dmarc.html ;\ + test=[[ '%s' == *rmz.io* ]] +application/zip; funzip | xsltproc $XDG_CONFIG_HOME/mutt/dmarc.xsl - > /tmp/dmarc.html && qutebrowser /tmp/dmarc.html ;\ + test=[[ '%s' == *rmz.io* ]] +application/gzip; zcat | xmllint --format - ; copiousoutput ; test=[[ '%s' == *rmz.io* ]] +application/zip; funzip | xmllint --format - ; copiousoutput ; test=[[ '%s' == *rmz.io* ]] application/*; $XDG_CONFIG_HOME/mutt/mutt_bgrun rifle -f F %s; image/*; rifle -f F %s; -- 2.48.1