54b02d43c7f3b4f4892ec2d69f3456e15679b1d3
2 /********************************************************************************
3 * include/plugin_bogofilter.inc.php : A Match Plugin using bogofilter
4 * ---------------------------------
6 * This file is part of the philter distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 class BogoPlugin
extends MatchPlugin
{
11 function BogoPlugin($_glob=false
) { $this->MatchPlugin($_glob); }
12 function rtti() { return 1; }
13 function name() { return _i18n('1_bogo'); }
15 /* the plugin is only global */
16 function is_global() { return true
; }
18 function to_string($_data) {
19 if($_data['data']=='off')
26 . " /var/mail/spam/\n"
28 . " SUBJECT=| formail -xSubject:\n"
30 . " | formail -I \"X-Spam-Flag: YES\" -i \"Subject: [Xorg:SPAM]$"."SUBJECT\"\n"
31 . ($_data["data"] == "drop" ?
" :0\n /dev/null\n" : "")
34 . "/var/mail/nonspam/\n"
40 function to_form($_data) {
41 $res = "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\">\n"
42 . "<tr><th width=\"25%\">BogoFilter</th>\n";
44 $res .= "<td><input type='hidden' name='global[1][0]' value='1' />\n"
45 . " <input type='radio' name='global[1][1]' value='0' "
46 . ($_data[1]==0 ?
'checked="checked "' : '')."/>"._i18n('1_bogo_off')."<br />\n"
47 . " <input type='radio' name='global[1][1]' value='1' "
48 . ($_data[1]==1 ?
'checked="checked "' : '')."/>"._i18n('1_bogo_on')."<br />\n"
49 . " <input type='radio' name='global[1][1]' value='2' "
50 . ($_data[1]==2 ?
'checked="checked "' : '')."/>"._i18n('1_bogo_drop')."<br />\n"
60 /********************************************************************************
62 * vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
63 ********************************************************************************/