summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/fh23
1 files changed, 23 insertions, 0 deletions
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 }