diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-20 15:06:47 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-20 15:06:47 +0200 |
commit | 5918e020ae87a266a592807fa7c6154521758a44 (patch) | |
tree | 080b8af2d4a020984659da9a961283d8abff658f | |
parent | eb5b7969f4d455307f5e3d82807c461ebe18fb86 (diff) | |
download | mum-5918e020ae87a266a592807fa7c6154521758a44.tar.gz |
Add 'fh' script
This script is designed to filter out unnecessary headers from the
mbox index.
-rwxr-xr-x | src/fh | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 } |