3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 # (Except where explictly superceded by other copyright notices)
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
24 package RT::Interface::Email::Filter::SpamAssassin;
26 use Mail::SpamAssassin;
27 my $spamtest = Mail::SpamAssassin->new();
31 my $status = $spamtest->check ($item);
32 return (undef, 0) unless $status->is_spam();
33 eval { $status->rewrite_mail() };
34 if ($status->get_hits > $status->get_required_hits()*1.5) {
43 RT::Interface::Email::Filter::SpamAssassin - Spam filter for RT
47 @RT::MailPlugins = ("Filter::SpamAssassin", ...);
51 This plugin checks to see if an incoming mail is spam (using
52 C<spamassassin>) and if so, rewrites its headers. If the mail is very
53 definitely spam - 1.5x more hits than required - then it is dropped on
54 the floor; otherwise, it is passed on as normal.
58 eval "require RT::Interface::Email::Filter::SpamAssassin_Vendor";
59 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Filter/SpamAssassin_Vendor.pm});
60 eval "require RT::Interface::Email::Filter::SpamAssassin_Local";
61 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Filter/SpamAssassin_Local.pm});