summaryrefslogtreecommitdiff
path: root/src/m-filter
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-05-26 01:33:06 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-05-26 01:34:47 +0200
commitca98b2ba8799b40ca0fe5b38b34c817a0215b119 (patch)
treee4ee153b32bd245939b9488a9aad8bcc87282ebb /src/m-filter
parent61205f34eccdaf65d639cf15f7599ebe4830d5f9 (diff)
downloadmum-ca98b2ba8799b40ca0fe5b38b34c817a0215b119.tar.gz
Improve 'm-pop' script
Username and password have been moved to environment variables. Command-line interface has improved.
Diffstat (limited to 'src/m-filter')
-rwxr-xr-xsrc/m-filter25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/m-filter b/src/m-filter
new file mode 100755
index 0000000..756f8b6
--- /dev/null
+++ b/src/m-filter
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -p
+
+# m-filter -- filter headers
+
+# Edit this script to your own preferences.
+
+BEGIN {
+ sub header { $_ =~ shift .. not $next =~ /^[ \t]/ }
+ sub skip { $_ = '' }
+}
+
+($_, $next) = ($next, $_);
+skip if header qr/^X-(?!(
+ Mailer
+ | Rspamd-\S+
+):)/xi;
+skip if header qr/^(
+ Received
+ | Received-SPF
+ | (DKIM|DomainKey)-Signature
+ | ARC-\S+
+ | IronPort-\S+
+):/x;
+
+END { print $next }