From 5918e020ae87a266a592807fa7c6154521758a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 20 May 2021 15:06:47 +0200 Subject: Add 'fh' script This script is designed to filter out unnecessary headers from the mbox index. --- src/fh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/fh diff --git a/src/fh b/src/fh new file mode 100755 index 0000000..0907aba --- /dev/null +++ b/src/fh @@ -0,0 +1,23 @@ +#!/usr/bin/perl -p + +# fh -- filter headers + +BEGIN { + sub header { $_ =~ shift .. not $next =~ /^[ \t]/ } + sub skip { $_ = '' } +} + +($_, $next) = ($next, $_); +skip if header qr/^X-\S+:/i and not header qr/^( + X-Mailer + | X-Virus-Scanned +):/x; +skip if header qr/^( + Received + | Received-SPF + | (DKIM|DomainKey)-Signature + | ARC-Message-Signature + | IronPort-\S+ +):/x; + +END { print $next } -- cgit v1.2.3