Helpful filters

---------

Mark Bradford (mark@ofps.ucar.EDU)
Thu, 10 Aug 1995 11:29:03 +0000


My sympathies to all my fellow mail-flood sufferers, particularly those
whose spool partitions are overflown by the incredible spam. (Before I
got to work this morning, I received over 450 copies of the 900+ line
message, and my FAQ-list spool was about 18 megs in size.)

I quickly slapped together the following .maildelivery lines and Perl
script, which may be of use to those of you who use slocal or other
filters:

.maildelivery:
#
# REPLACE /home/mark WITH APPROPRIATE DIRECTORY
#
# First, pass through filter, which will discard long messages:
to faq | A /home/mark/faqsort.p
cc faq | A /home/mark/faqsort.p
to <faq-maintainers@MIT.EDU> | A /home/mark/faqsort.p
# Next, file messages that make it through.
to faq > ? /home/mark/Mail/newfaq
cc faq > ? /home/mark/Mail/newfaq
to <faq-maintainers@MIT.EDU> > ? /home/mark/Mail/newfaq

faqsort.p:
#!/bin/perl

@text=<>; #slurp in entire message
$lines=scalar(@text); #number of lines in message
if (scalar(@text) < 500) {
# exit with "failed to deliver" code, so .maildelivery will try next rule
exit 1;
}
# Pretend message delivery succeeded; message ends up in bit bucket
exit 0;

-- Mark Bradford, Software Engineer <> mark@ucar.edu
UCAR Office of Field Project Support <> (303) 497-8169



[ Usenet Hypertext FAQ Archive | Search Mail Archive | Authors | Usenet ]
[ 1993 | 1994 | 1995 | 1996 | 1997 ]

---------

faq-admin@landfield.com

© Copyright The Landfield Group, 1997
All rights reserved