From 072b6fa56d0a6759bab5f665ef36ed6afc5c9d8b Mon Sep 17 00:00:00 2001 From: Andrew Lorimer Date: Thu, 27 Dec 2018 22:37:37 +1100 Subject: [PATCH 1/1] add postfix cleaner for charles --- postfix-delete.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 postfix-delete.pl diff --git a/postfix-delete.pl b/postfix-delete.pl new file mode 100755 index 0000000..ab75701 --- /dev/null +++ b/postfix-delete.pl @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +$REGEXP = shift || die "no email-adress given (regexp-style, e.g. bl.*\@yahoo.com)!"; + +@data = qx; +for (@data) { + if (/^(\w+)(\*|\!)?\s/) { + $queue_id = $1; + } + if($queue_id) { + if (/$REGEXP/i) { + $Q{$queue_id} = 1; + $queue_id = ""; + } + } +} + +#open(POSTSUPER,"|cat") || die "couldn't open postsuper" ; +open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ; + +foreach (keys %Q) { + print POSTSUPER "$_\n"; +}; +close(POSTSUPER); -- 2.47.0