Well, let me just say that procmail is an awful, awful program. However, my system won't let me use anything nice (like say, a perl script using Mail::Procmail) to filter mail. After about a week, I've finally worked up a set of rules that seem to catch 95% or more of all my spam messages.

As part of my ruleset, I check the 'from:' header of the message against my pine .addressbook file, and if the user is known they go into the inbox -- essentially a whitelist scheme. I wrote a little perl script to check the values.

#!/usr/local/bin/perl use strict; exit 1 unless (my $mail_from = <>); exit 1 unless open (AD,'/home/ajdelore/.addressbook'); while (<AD>) { my $addr = (split /\t/)[2]; $addr =~ s/\s+//g; exit 0 if $mail_from =~ /$addr/i; } exit 1;

The rule I use in procmail is:

:0 * ^From:\/.* { :0: * ? echo $MATCH | /home/ajdelore/bin/check_addr.pl ${DEFAULT} }

</ajdelore>

Replies are listed 'Best First'.
Re: Procmail+Pine spam filtering
by japh (Friar) on Apr 09, 2002 at 05:32 UTC
    See also the mighty fine SpamAssassin, which has been doing a better job for me than an unnamed commercial service, and has the additional benefit of being written in perl so you can both extend it and learn from it.