|
QuasiSpamFilter_Plugin
A reference implementation of a Spam filter plugin.
Quasi-Spam Filter PluginA reference implementation of a Spam filter plugin. /!\ I strongly recommend you to use SpamLookup plugin bundled with Movable Type 3.2. I won't maintenance this any more. Changes
OverviewThis is a reference implementation of a Spam filter plugin and mainly targetted to spam filter developpers as well as actual users. This plugin allows you to easily customize your filtering policy and your reaction to comment & trackback spammers. How to customizeFiltering PolicyThe default policy of this plugin is to drop comments and trackback pings which have H1 and A elements. If you want to change your target, you can customize $COMMENT_PATTERN and $TBPING_PATTERN variable. # Set your spam pattern our $COMMENT_PATTERN = '<h1>|<a\s'; # H1 or A elements our $TBPING_PATTERN = '<h1>|<a\s'; # H1 or A elements You can change the is_comment_spam and is_tbping_spam subroutines if you want more clever mechanisms for filtering. sub is_comment_spam {
my $comment = shift;
return ($comment->text =~ /$COMMENT_PATTERN/i);
}
sub is_tbping_spam {
my $tbping = shift;
return ($tbping->excerpt =~ /$TBPING_PATTERN/i);
}Reaction to Commment SpammersThe default reaction to comment spammers is "NOT TO TELL SPAMMERS WHETHER COMMENT SUBMISSIONS ARE SUCCEEDED OR NOT, BUT KILL THEM" reaction :) The Quasi-Spam Filter Plugin supports the following six reactions to comment spammers. And you can choose one of them by setting $COMMENT_METHOD variable. CommentFilterThis method does not tell spammers whether comment submissions are succeeded or not. CommentThrottleFilterThis method tells spammers that their comment submissions are failed by MT throttling mechanism. CommentError (Default)Just outputs a simple "Spam Comment!" message. This is the most light-weight solution. CommentLongErrorOutputs a kind error message by using "Comment Error Template". CommentRedirectRedirects to the URL specified by $URL variable. You can leed spammers to "Enlightment" site, or "Bizarre" site, or whatever else. CommentEvilRedirectRedirects to the URL specified by the URL field of spammers. If no URL is filled, redirects to the URL specified by $URL variable. If you want to stop filtering spam comments, just set anything else (ex. '') to $COMMENT_METHOD variable. Reaction to Trackback SpammersThe default reaction to trackback spammers is "NOT TO TELL SPAMMERS WHETHER TRACKBACK PINGS ARE SUCCEEDED OR NOT, BUT KILL THEM" reaction :) The Quasi-Spam Filter Plugin supports the following three reactions to trackback spammers. And you can choose one of them by setting $TBPING_METHOD variable. TBPingFilterThis method does not tell spammers whether trackback pings are succeeded or not. TBPingThrottleFilterThis method tells spammers that their trackback pings are failed by MT throttling mechanism. TBPingError (Default)Just outputs a simple "TBPing Comment!" message. This is the most light-weight solution. If you want to stop filtering spam TB pings, just set anything else (ex. '') to $TBPPING_METHOD variable. See AlsoLicenseThis code is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html. Author & CopyrightCopyright 2004, Hirotaka Ogawa (hirotaka.ogawa at gmail.com) |
Can some one help me solve a problem:
I get a lot of spam mails where the sender is me and receiver is also me (eg: from: anu.eengineers@gmail.com and receiver is anu.eengineers@gmail.com. Can I have some filter that can simply block all such mails where from and To are teh same email address (not when my name is in CC or Bcc).
Thanks, Anu