[rochester-pm-list] spam detection
Shawn Porter
sporter at rit.net
Tue Feb 15 18:26:40 CST 2000
Here is another cool Perl script. I didn't write this one but I changed
it a bit and I use it a lot.
--
#!/usr/local/bin/perl
$spam = <STDIN>;
$from = $spam;
while ( <STDIN> )
{
$spam .= $_;
}
if ( $from =~ /^From (.*@\S*)/ )
{
$address = $1;
}
open(MAIL, "|/usr/sbin/sendmail $address");
print MAIL<<SPAM;
Subject: Spam Detection and Response System
This is an automated message.
Dear $address :
Sorry, but mail from your address was returned as unread, either because:
1) Your particular address or domain (geocities.com, surfree.com, etc.) is
a known spam/chain-letter site or
2) the content of your message was automatically analyzed and determined
to be spam or
3) you have ignored this user's request to unsubscribe from your
mailing list
To bypass my mail filtering, you can:
1) Resubmit your message and include the semi-random and freqently
changing bypass string (listed below) in the subject
Bypass string:
frisco44
The content of your message is shown below.
############RETURNED MESSAGE FOLLOWS############
$spam
SPAM
close(MAIL);
--
It works in conjunction with my Procmail/Fetchmail setup on my Linux box..
To direct spam to this script I just add the following to my Procmail conf
files.
:0
* ^From.*surfree.com
| $HOMEDIR/bin/mailback
Of course, you'd want to take measures to ensure that legit mail gets
through... but that is Procmail's job, not Perl's.
Enjoy.
--
Shawn Porter
http://www.rit.net/sporter
work - 716-223-3610 x116
home - 716-242-8742
cell - 716-615-7812
sporter at rit.net
----------
For information on unsubscribing from this list, please visit http://rochester.pm.org
More information about the Rochester-pm
mailing list