Subject: filter

From: Gaal Yahas <[email-masked]>
Date: Sun, 7 May 2000 21:08:19 +0300

Anyway, here's something I had been meaning to write for a while
now and only unlazed enough to actually DO today.

Put this in your .procmailrc or something, for egroups email only,
and don't even THINK of blaming me if it eats your mail :-)

==snip==
#!/usr/bin/perl -wn

# strip ads from eGroups mail

use strict;
use vars '$buf';

my $lines;

if (1 .. /^-{72}$/) {    # legit part of the message fer sure
    print;
} else {
    if (/^-{72}$/) {
        $lines++;
        if ($lines > 2) {
            print $buf;    # what we had was probably legit
            $lines = 0;
            $buf   = '';
        }
    }
    $buf .= $_;    # remember this line
}

END {
    $buf =~ s/\A.*^-{72}\n//sm;   # strip out ad
    print $buf;                   # print what's left (unsub info usually)
}

__END__
==snip==

-- 
believing is seeing
[email-masked]
http://www.forum2.org/gaal/