| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Message and Spam Filter Plugin |
| 5 | * |
| 6 | * Copyright (c) 1999-2003 The SquirrelMail Project Team |
| 7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
| 8 | * |
| 9 | * This plugin filters your inbox into different folders based upon given |
| 10 | * criteria. It is most useful for people who are subscibed to mailing lists |
| 11 | * to help organize their messages. The argument stands that filtering is |
| 12 | * not the place of the client, which is why this has been made a plugin for |
| 13 | * SquirrelMail. You may be better off using products such as Sieve or |
| 14 | * Procmail to do your filtering so it happens even when SquirrelMail isn't |
| 15 | * running. |
| 16 | * |
| 17 | * If you need help with this, or see improvements that can be made, please |
| 18 | * email me directly at the address above. I definately welcome suggestions |
| 19 | * and comments. This plugin, as is the case with all SquirrelMail plugins, |
| 20 | * is not directly supported by the developers. Please come to me off the |
| 21 | * mailing list if you have trouble with it. |
| 22 | * |
| 23 | * Also view plugins/README.plugins for more information. |
| 24 | * |
| 25 | * $Id$ |
| 26 | */ |
| 27 | |
| 28 | function filters_SaveCache () { |
| 29 | global $data_dir, $SpamFilters_DNScache; |
| 30 | |
| 31 | if (file_exists($data_dir . '/dnscache')) { |
| 32 | $fp = fopen($data_dir . '/dnscache', 'r'); |
| 33 | } else { |
| 34 | $fp = false; |
| 35 | } |
| 36 | if ($fp) { |
| 37 | flock($fp,LOCK_EX); |
| 38 | } else { |
| 39 | $fp = fopen($data_dir . '/dnscache', 'w+'); |
| 40 | fclose($fp); |
| 41 | $fp = fopen($data_dir . '/dnscache', 'r'); |
| 42 | flock($fp,LOCK_EX); |
| 43 | } |
| 44 | $fp1=fopen($data_dir . '/dnscache', 'w+'); |
| 45 | |
| 46 | foreach ($SpamFilters_DNScache as $Key=> $Value) { |
| 47 | $tstr = $Key . ',' . $Value['L'] . ',' . $Value['T'] . "\n"; |
| 48 | fputs ($fp1, $tstr); |
| 49 | } |
| 50 | fclose($fp1); |
| 51 | flock($fp,LOCK_UN); |
| 52 | fclose($fp); |
| 53 | } |
| 54 | |
| 55 | function filters_LoadCache () { |
| 56 | global $data_dir, $SpamFilters_DNScache; |
| 57 | |
| 58 | if (file_exists($data_dir . '/dnscache')) { |
| 59 | $SpamFilters_DNScache = array(); |
| 60 | if ($fp = fopen ($data_dir . '/dnscache', 'r')) { |
| 61 | flock($fp,LOCK_SH); |
| 62 | while ($data=fgetcsv($fp,1024)) { |
| 63 | if ($data[2] > time()) { |
| 64 | $SpamFilters_DNScache[$data[0]]['L'] = $data[1]; |
| 65 | $SpamFilters_DNScache[$data[0]]['T'] = $data[2]; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | flock($fp,LOCK_UN); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | function filters_bulkquery($filters_spam_scan, $filters, $read) { |
| 75 | global $SpamFilters_YourHop, $attachment_dir, $username, |
| 76 | $SpamFilters_DNScache, $SpamFilters_BulkQuery, |
| 77 | $SpamFilters_CacheTTL; |
| 78 | |
| 79 | $IPs = array(); |
| 80 | $i = 0; |
| 81 | while ($i < count($read)) { |
| 82 | // EIMS will give funky results |
| 83 | $Chunks = explode(' ', $read[$i]); |
| 84 | if ($Chunks[0] != '*') { |
| 85 | $i ++; |
| 86 | continue; |
| 87 | } |
| 88 | $MsgNum = $Chunks[1]; |
| 89 | |
| 90 | $i ++; |
| 91 | |
| 92 | // Look through all of the Received headers for IP addresses |
| 93 | // Stop when I get ")" on a line |
| 94 | // Stop if I get "*" on a line (don't advance) |
| 95 | // and above all, stop if $i is bigger than the total # of lines |
| 96 | while (($i < count($read)) && |
| 97 | ($read[$i][0] != ')' && $read[$i][0] != '*' && |
| 98 | $read[$i][0] != "\n")) { |
| 99 | // Check to see if this line is the right "Received from" line |
| 100 | // to check |
| 101 | if (is_int(strpos($read[$i], $SpamFilters_YourHop))) { |
| 102 | $read[$i] = ereg_replace('[^0-9\.]', ' ', $read[$i]); |
| 103 | $elements = explode(' ', $read[$i]); |
| 104 | foreach ($elements as $value) { |
| 105 | if ($value != '' && |
| 106 | ereg('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', |
| 107 | $value, $regs)) { |
| 108 | $Chunks = explode('.', $value); |
| 109 | $IP = $Chunks[3] . '.' . $Chunks[2] . '.' . |
| 110 | $Chunks[1] . '.' . $Chunks[0]; |
| 111 | foreach ($filters as $key => $value) { |
| 112 | if ($filters[$key]['enabled'] && |
| 113 | $filters[$key]['dns']) { |
| 114 | if (strlen($SpamFilters_DNScache[$IP.'.'.$filters[$key]['dns']]) == 0) { |
| 115 | $IPs[$IP] = true; |
| 116 | break; |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | // If we've checked one IP and YourHop is |
| 121 | // just a space |
| 122 | if ($SpamFilters_YourHop == ' ') { |
| 123 | break; // don't check any more |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | $i ++; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | if (count($IPs) > 0) { |
| 133 | $rbls = array(); |
| 134 | foreach ($filters as $key => $value) { |
| 135 | if ($filters[$key]['enabled']) { |
| 136 | if ($filters[$key]['dns']) { |
| 137 | $rbls[$filters[$key]['dns']] = true; |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | $bqfil = $attachment_dir . $username . '-bq.in'; |
| 143 | $fp = fopen($bqfil, 'w'); |
| 144 | fputs ($fp, $SpamFilters_CacheTTL . "\n"); |
| 145 | foreach ($rbls as $key => $value) { |
| 146 | fputs ($fp, '.' . $key . "\n"); |
| 147 | } |
| 148 | fputs ($fp, "----------\n"); |
| 149 | foreach ($IPs as $key => $value) { |
| 150 | fputs ($fp, $key . "\n"); |
| 151 | } |
| 152 | fclose ($fp); |
| 153 | $bqout = array(); |
| 154 | exec ($SpamFilters_BulkQuery . ' < ' . $bqfil, $bqout); |
| 155 | foreach ($bqout as $value) { |
| 156 | $Chunks = explode(',', $value); |
| 157 | $SpamFilters_DNScache[$Chunks[0]]['L'] = $Chunks[1]; |
| 158 | $SpamFilters_DNScache[$Chunks[0]]['T'] = $Chunks[2] + time(); |
| 159 | } |
| 160 | unlink($bqfil); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | function start_filters() { |
| 165 | global $mailbox, $imapServerAddress, $imapPort, $imap, |
| 166 | $imap_general, $filters, $imap_stream, $imapConnection, |
| 167 | $UseSeparateImapConnection, $AllowSpamFilters; |
| 168 | |
| 169 | sqgetGlobalVar('username', $username, SQ_SESSION); |
| 170 | sqgetGlobalVar('key', $key, SQ_COOKIE); |
| 171 | |
| 172 | # if ($mailbox == 'INBOX') { |
| 173 | // Detect if we have already connected to IMAP or not. |
| 174 | // Also check if we are forced to use a separate IMAP connection |
| 175 | if ((!isset($imap_stream) && !isset($imapConnection)) || |
| 176 | $UseSeparateImapConnection) { |
| 177 | $stream = sqimap_login($username, $key, $imapServerAddress, |
| 178 | $imapPort, 10); |
| 179 | $previously_connected = false; |
| 180 | } elseif (isset($imapConnection)) { |
| 181 | $stream = $imapConnection; |
| 182 | $previously_connected = true; |
| 183 | } else { |
| 184 | $previously_connected = true; |
| 185 | $stream = $imap_stream; |
| 186 | } |
| 187 | |
| 188 | if (sqimap_get_num_messages($stream, 'INBOX') > 0) { |
| 189 | // Filter spam from inbox before we sort them into folders |
| 190 | if ($AllowSpamFilters) { |
| 191 | spam_filters($stream); |
| 192 | } |
| 193 | |
| 194 | // Sort into folders |
| 195 | user_filters($stream); |
| 196 | } |
| 197 | |
| 198 | if (!$previously_connected) { |
| 199 | sqimap_logout($stream); |
| 200 | } |
| 201 | # } |
| 202 | } |
| 203 | |
| 204 | function user_filters($imap_stream) { |
| 205 | global $data_dir, $username; |
| 206 | $filters = load_filters(); |
| 207 | if (! $filters) return; |
| 208 | $filters_user_scan = getPref($data_dir, $username, 'filters_user_scan'); |
| 209 | |
| 210 | sqimap_mailbox_select($imap_stream, 'INBOX'); |
| 211 | $id = array(); |
| 212 | // For every rule |
| 213 | for ($i=0, $num = count($filters); $i < $num; $i++) { |
| 214 | // If it is the "combo" rule |
| 215 | if ($filters[$i]['where'] == 'To or Cc') { |
| 216 | /* |
| 217 | * If it's "TO OR CC", we have to do two searches, one for TO |
| 218 | * and the other for CC. |
| 219 | */ |
| 220 | $id = filter_search_and_delete($imap_stream, 'TO', |
| 221 | $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $id); |
| 222 | $id = filter_search_and_delete($imap_stream, 'CC', |
| 223 | $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $id); |
| 224 | } else { |
| 225 | /* |
| 226 | * If it's a normal TO, CC, SUBJECT, or FROM, then handle it |
| 227 | * normally. |
| 228 | */ |
| 229 | $id = filter_search_and_delete($imap_stream, $filters[$i]['where'], |
| 230 | $filters[$i]['what'], $filters[$i]['folder'], $filters_user_scan, $id); |
| 231 | } |
| 232 | } |
| 233 | // Clean out the mailbox whether or not auto_expunge is on |
| 234 | // That way it looks like it was redirected properly |
| 235 | if (count($id)) { |
| 236 | sqimap_mailbox_expunge($imap_stream, 'INBOX'); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | function filter_search_and_delete($imap, $where, $what, $where_to, $user_scan, |
| 241 | $del_id) { |
| 242 | global $languages, $squirrelmail_language, $allow_charset_search, |
| 243 | $uid_support, $imap_server_type; |
| 244 | if ($user_scan == 'new') { |
| 245 | $category = 'UNSEEN'; |
| 246 | } else { |
| 247 | $category = 'ALL'; |
| 248 | } |
| 249 | |
| 250 | if ($allow_charset_search && |
| 251 | isset($languages[$squirrelmail_language]['CHARSET']) && |
| 252 | $languages[$squirrelmail_language]['CHARSET']) { |
| 253 | $search_str = 'SEARCH CHARSET ' |
| 254 | . strtoupper($languages[$squirrelmail_language]['CHARSET']) |
| 255 | . ' ' . $category; |
| 256 | } else { |
| 257 | $search_str = 'SEARCH CHARSET US-ASCII ' . $category; |
| 258 | } |
| 259 | if ($where == 'Header') { |
| 260 | $what = explode(':', $what); |
| 261 | $where = trim($where . ' ' . $what[0]); |
| 262 | $what = addslashes(trim($what[1])); |
| 263 | } |
| 264 | |
| 265 | if ($imap_server_type == 'macosx') { |
| 266 | $search_str .= ' ' . $where . ' ' . $what; |
| 267 | } else { |
| 268 | $search_str .= ' ' . $where . ' {' . strlen($what) . "}\r\n" |
| 269 | . $what . "\r\n"; |
| 270 | } |
| 271 | |
| 272 | /* read data back from IMAP */ |
| 273 | $read = sqimap_run_command($imap, $search_str, true, $response, $message, $uid_support); |
| 274 | |
| 275 | // This may have problems with EIMS due to it being goofy |
| 276 | |
| 277 | for ($r=0, $num = count($read); $r < $num && |
| 278 | substr($read[$r], 0, 8) != '* SEARCH'; $r++) {} |
| 279 | if ($response == 'OK') { |
| 280 | $ids = explode(' ', $read[$r]); |
| 281 | if (sqimap_mailbox_exists($imap, $where_to)) { |
| 282 | for ($j=2, $num = count($ids); $j < $num; $j++) { |
| 283 | $id = trim($ids[$j]); |
| 284 | $del_id[] = $id; |
| 285 | sqimap_messages_copy ($imap, $id, $id, $where_to); |
| 286 | sqimap_messages_flag ($imap, $id, $id, 'Deleted',false); |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | return $del_id; |
| 291 | } |
| 292 | |
| 293 | // These are the spam filters |
| 294 | function spam_filters($imap_stream) { |
| 295 | global $data_dir, $username, $uid_support; |
| 296 | global $SpamFilters_YourHop; |
| 297 | global $SpamFilters_DNScache; |
| 298 | global $SpamFilters_SharedCache; |
| 299 | global $SpamFilters_BulkQuery; |
| 300 | |
| 301 | $filters_spam_scan = getPref($data_dir, $username, 'filters_spam_scan'); |
| 302 | $filters_spam_folder = getPref($data_dir, $username, 'filters_spam_folder'); |
| 303 | $filters = load_spam_filters(); |
| 304 | |
| 305 | if ($SpamFilters_SharedCache) { |
| 306 | filters_LoadCache(); |
| 307 | } |
| 308 | |
| 309 | $run = 0; |
| 310 | |
| 311 | foreach ($filters as $Key=> $Value) { |
| 312 | if ($Value['enabled']) { |
| 313 | $run ++; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | // short-circuit |
| 318 | if ($run == 0) { |
| 319 | return; |
| 320 | } |
| 321 | |
| 322 | sqimap_mailbox_select($imap_stream, 'INBOX'); |
| 323 | |
| 324 | // Ask for a big list of all "Received" headers in the inbox with |
| 325 | // flags for each message. Kinda big. |
| 326 | if ($filters_spam_scan != 'new') { |
| 327 | $read = sqimap_run_command($imap_stream, 'FETCH 1:* (FLAGS BODY.PEEK[HEADER.FIELDS ' . |
| 328 | '(RECEIVED)])', true, $response, $message, $uid_support); |
| 329 | } else { |
| 330 | $read = sqimap_run_command($imap_stream, 'SEARCH UNSEEN', true, $response, $message, $uid_support); |
| 331 | if ($response != 'OK' || trim($read[0]) == '* SEARCH') { |
| 332 | $read = sqimap_run_command($imap_stream, 'FETCH 1:* (FLAGS BODY.PEEK[HEADER.FIELDS ' . |
| 333 | '(RECEIVED)])', true, $response, $message, $uid_support); |
| 334 | } else { |
| 335 | if (isset($read[0])) { |
| 336 | if (preg_match("/^\* SEARCH (.+)$/", $read[0], $regs)) { |
| 337 | $search_array = preg_split("/ /", trim($regs[1])); |
| 338 | } |
| 339 | } |
| 340 | $msgs_str = sqimap_message_list_squisher($search_array); |
| 341 | $imap_query = 'FETCH '.$msgs_str; |
| 342 | $imap_query .= ' (FLAGS BODY.PEEK[HEADER.FIELDS '; |
| 343 | $imap_query .= '(RECEIVED)])'; |
| 344 | $read = sqimap_run_command($imap_stream,$imap_query, true, $response, $message, $uid_support); |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | if (isset($response) && $response != 'OK') { |
| 349 | return; |
| 350 | } |
| 351 | |
| 352 | if (strlen($SpamFilters_BulkQuery) > 0) { |
| 353 | filters_bulkquery($filters_spam_scan, $filters, $read); |
| 354 | } |
| 355 | |
| 356 | $i = 0; |
| 357 | while ($i < count($read)) { |
| 358 | // EIMS will give funky results |
| 359 | $Chunks = explode(' ', $read[$i]); |
| 360 | if ($Chunks[0] != '*') { |
| 361 | $i ++; |
| 362 | continue; |
| 363 | } |
| 364 | $MsgNum = $Chunks[1]; |
| 365 | |
| 366 | $IPs = array(); |
| 367 | $i ++; |
| 368 | $IsSpam = 0; |
| 369 | |
| 370 | // Look through all of the Received headers for IP addresses |
| 371 | // Stop when I get ")" on a line |
| 372 | // Stop if I get "*" on a line (don't advance) |
| 373 | // and above all, stop if $i is bigger than the total # of lines |
| 374 | while (($i < count($read)) && |
| 375 | ($read[$i][0] != ')' && $read[$i][0] != '*' && |
| 376 | $read[$i][0] != "\n") && (! $IsSpam)) { |
| 377 | // Check to see if this line is the right "Received from" line |
| 378 | // to check |
| 379 | if (is_int(strpos($read[$i], $SpamFilters_YourHop))) { |
| 380 | |
| 381 | // short-circuit and skip work if we don't scan this one |
| 382 | $read[$i] = ereg_replace('[^0-9\.]', ' ', $read[$i]); |
| 383 | $elements = explode(' ', $read[$i]); |
| 384 | foreach ($elements as $value) { |
| 385 | if ($value != '' && |
| 386 | ereg('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', |
| 387 | $value, $regs)) { |
| 388 | $Chunks = explode('.', $value); |
| 389 | if (filters_spam_check_site($Chunks[0], |
| 390 | $Chunks[1], $Chunks[2], $Chunks[3], |
| 391 | $filters)) { |
| 392 | $IsSpam ++; |
| 393 | break; // no sense in checking more IPs |
| 394 | } |
| 395 | // If we've checked one IP and YourHop is |
| 396 | // just a space |
| 397 | if ($SpamFilters_YourHop == ' ') { |
| 398 | break; // don't check any more |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | } |
| 403 | $i ++; |
| 404 | } |
| 405 | |
| 406 | // Lookie! It's spam! Yum! |
| 407 | if ($IsSpam) { |
| 408 | if (sqimap_mailbox_exists($imap_stream, $filters_spam_folder)) { |
| 409 | sqimap_messages_copy ($imap_stream, $MsgNum, $MsgNum, |
| 410 | $filters_spam_folder); |
| 411 | sqimap_messages_flag ($imap_stream, $MsgNum, $MsgNum, |
| 412 | 'Deleted', false); |
| 413 | } |
| 414 | } else { |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | sqimap_mailbox_expunge($imap_stream, 'INBOX'); |
| 419 | |
| 420 | if ($SpamFilters_SharedCache) { |
| 421 | filters_SaveCache(); |
| 422 | } else { |
| 423 | sqsession_register($SpamFilters_DNScache, 'SpamFilters_DNScache'); |
| 424 | } |
| 425 | |
| 426 | } |
| 427 | |
| 428 | // Does the loop through each enabled filter for the specified IP address. |
| 429 | // IP format: $a.$b.$c.$d |
| 430 | function filters_spam_check_site($a, $b, $c, $d, &$filters) { |
| 431 | global $SpamFilters_DNScache, $SpamFilters_CacheTTL; |
| 432 | foreach ($filters as $key => $value) { |
| 433 | if ($filters[$key]['enabled']) { |
| 434 | if ($filters[$key]['dns']) { |
| 435 | $filter_revip = $d . '.' . $c . '.' . $b . '.' . $a . '.' . |
| 436 | $filters[$key]['dns']; |
| 437 | |
| 438 | if(!isset($SpamFilters_DNScache[$filter_revip]['L'])) |
| 439 | $SpamFilters_DNScache[$filter_revip]['L'] = ''; |
| 440 | |
| 441 | if(!isset($SpamFilters_DNScache[$filter_revip]['T'])) |
| 442 | $SpamFilters_DNScache[$filter_revip]['T'] = ''; |
| 443 | |
| 444 | if (strlen($SpamFilters_DNScache[$filter_revip]['L']) == 0) { |
| 445 | $SpamFilters_DNScache[$filter_revip]['L'] = |
| 446 | gethostbyname($filter_revip); |
| 447 | $SpamFilters_DNScache[$filter_revip]['T'] = |
| 448 | time() + $SpamFilters_CacheTTL; |
| 449 | } |
| 450 | if ($SpamFilters_DNScache[$filter_revip]['L'] == |
| 451 | $filters[$key]['result']) { |
| 452 | return 1; |
| 453 | } |
| 454 | } |
| 455 | } |
| 456 | } |
| 457 | return 0; |
| 458 | } |
| 459 | |
| 460 | function load_filters() { |
| 461 | global $data_dir, $username; |
| 462 | |
| 463 | $filters = array(); |
| 464 | for ($i=0; $fltr = getPref($data_dir, $username, 'filter' . $i); $i++) { |
| 465 | $ary = explode(',', $fltr); |
| 466 | $filters[$i]['where'] = $ary[0]; |
| 467 | $filters[$i]['what'] = $ary[1]; |
| 468 | $filters[$i]['folder'] = $ary[2]; |
| 469 | } |
| 470 | return $filters; |
| 471 | } |
| 472 | |
| 473 | function load_spam_filters() { |
| 474 | global $data_dir, $username, $SpamFilters_ShowCommercial; |
| 475 | |
| 476 | if ($SpamFilters_ShowCommercial) { |
| 477 | $filters['MAPS RBL']['prefname'] = 'filters_spam_maps_rbl'; |
| 478 | $filters['MAPS RBL']['name'] = 'MAPS Realtime Blackhole List'; |
| 479 | $filters['MAPS RBL']['link'] = 'http://www.mail-abuse.org/rbl/'; |
| 480 | $filters['MAPS RBL']['dns'] = 'blackholes.mail-abuse.org'; |
| 481 | $filters['MAPS RBL']['result'] = '127.0.0.2'; |
| 482 | $filters['MAPS RBL']['comment'] = |
| 483 | _("COMMERCIAL - This list contains servers that are verified spam senders. It is a pretty reliable list to scan spam from."); |
| 484 | |
| 485 | $filters['MAPS RSS']['prefname'] = 'filters_spam_maps_rss'; |
| 486 | $filters['MAPS RSS']['name'] = 'MAPS Relay Spam Stopper'; |
| 487 | $filters['MAPS RSS']['link'] = 'http://www.mail-abuse.org/rss/'; |
| 488 | $filters['MAPS RSS']['dns'] = 'relays.mail-abuse.org'; |
| 489 | $filters['MAPS RSS']['result'] = '127.0.0.2'; |
| 490 | $filters['MAPS RSS']['comment'] = |
| 491 | _("COMMERCIAL - Servers that are configured (or misconfigured) to allow spam to be relayed through their system will be banned with this. Another good one to use."); |
| 492 | |
| 493 | $filters['MAPS DUL']['prefname'] = 'filters_spam_maps_dul'; |
| 494 | $filters['MAPS DUL']['name'] = 'MAPS Dial-Up List'; |
| 495 | $filters['MAPS DUL']['link'] = 'http://www.mail-abuse.org/dul/'; |
| 496 | $filters['MAPS DUL']['dns'] = 'dialups.mail-abuse.org'; |
| 497 | $filters['MAPS DUL']['result'] = '127.0.0.3'; |
| 498 | $filters['MAPS DUL']['comment'] = |
| 499 | _("COMMERCIAL - Dial-up users are often filtered out since they should use their ISP's mail servers to send mail. Spammers typically get a dial-up account and send spam directly from there."); |
| 500 | |
| 501 | $filters['MAPS RBLplus-RBL']['prefname'] = 'filters_spam_maps_rblplus_rbl'; |
| 502 | $filters['MAPS RBLplus-RBL']['name'] = 'MAPS RBL+ RBL List'; |
| 503 | $filters['MAPS RBLplus-RBL']['link'] = 'http://www.mail-abuse.org/'; |
| 504 | $filters['MAPS RBLplus-RBL']['dns'] = 'rbl-plus.mail-abuse.org'; |
| 505 | $filters['MAPS RBLplus-RBL']['result'] = '127.0.0.2'; |
| 506 | $filters['MAPS RBLplus-RBL']['comment'] = |
| 507 | _("COMMERCIAL - RBL+ Blackhole entries."); |
| 508 | |
| 509 | $filters['MAPS RBLplus-RSS']['prefname'] = 'filters_spam_maps_rblplus_rss'; |
| 510 | $filters['MAPS RBLplus-RSS']['name'] = 'MAPS RBL+ List RSS entries'; |
| 511 | $filters['MAPS RBLplus-RSS']['link'] = 'http://www.mail-abuse.org/'; |
| 512 | $filters['MAPS RBLplus-RSS']['dns'] = 'rbl-plus.mail-abuse.org'; |
| 513 | $filters['MAPS RBLplus-RSS']['result'] = '127.0.0.2'; |
| 514 | $filters['MAPS RBLplus-RSS']['comment'] = |
| 515 | _("COMMERCIAL - RBL+ OpenRelay entries."); |
| 516 | |
| 517 | $filters['MAPS RBLplus-DUL']['prefname'] = 'filters_spam_maps_rblplus_dul'; |
| 518 | $filters['MAPS RBLplus-DUL']['name'] = 'MAPS RBL+ List DUL entries'; |
| 519 | $filters['MAPS RBLplus-DUL']['link'] = 'http://www.mail-abuse.org/'; |
| 520 | $filters['MAPS RBLplus-DUL']['dns'] = 'rbl-plus.mail-abuse.org'; |
| 521 | $filters['MAPS RBLplus-DUL']['result'] = '127.0.0.3'; |
| 522 | $filters['MAPS RBLplus-DUL']['comment'] = |
| 523 | _("COMMERCIAL - RBL+ Dial-up entries."); |
| 524 | } |
| 525 | |
| 526 | $filters['Osirusoft Relays']['prefname'] = 'filters_spam_maps_osirusoft_relay'; |
| 527 | $filters['Osirusoft Relays']['name'] = 'Osirusoft Relay List'; |
| 528 | $filters['Osirusoft Relays']['link'] = 'http://relays.osirusoft.com/'; |
| 529 | $filters['Osirusoft Relays']['dns'] = 'relays.osirusoft.com'; |
| 530 | $filters['Osirusoft Relays']['result'] = '127.0.0.2'; |
| 531 | $filters['Osirusoft Relays']['comment'] = |
| 532 | _("FREE - Osirusoft Relays - Osirusofts list of verified open relays. Seems to include servers used by abuse@uunet.net auto-replies too."); |
| 533 | |
| 534 | $filters['Osirusoft DUL']['prefname'] = 'filters_spam_maps_osirusoft_dul'; |
| 535 | $filters['Osirusoft DUL']['name'] = 'Osirusoft Dialup List'; |
| 536 | $filters['Osirusoft DUL']['link'] = 'http://relays.osirusoft.com/'; |
| 537 | $filters['Osirusoft DUL']['dns'] = 'relays.osirusoft.com'; |
| 538 | $filters['Osirusoft DUL']['result'] = '127.0.0.3'; |
| 539 | $filters['Osirusoft DUL']['comment'] = |
| 540 | _("FREE - Osirusoft Dialups - Osirusofts Dialup Spam Source list."); |
| 541 | |
| 542 | $filters['Osirusoft Spam Source']['prefname'] = 'filters_spam_maps_osirusoft_rc'; |
| 543 | $filters['Osirusoft Spam Source']['name'] = 'Osirusoft Confirmed Spam Source List'; |
| 544 | $filters['Osirusoft Spam Source']['link'] = 'http://relays.osirusoft.com/'; |
| 545 | $filters['Osirusoft Spam Source']['dns'] = 'relays.osirusoft.com'; |
| 546 | $filters['Osirusoft Spam Source']['result'] = '127.0.0.4'; |
| 547 | $filters['Osirusoft Spam Source']['comment'] = |
| 548 | _("FREE - Osirusoft Confirmed Spam Source - Sites that continually spam and have been manually added after multiple nominations. Use with caution. Seems to catch abuse auto-replies from some ISPs."); |
| 549 | |
| 550 | $filters['Osirusoft Smart Host']['prefname'] = 'filters_spam_maps_osirusoft_sh'; |
| 551 | $filters['Osirusoft Smart Host']['name'] = 'Osirusoft Smart Host List'; |
| 552 | $filters['Osirusoft Smart Host']['link'] = 'http://relays.osirusoft.com/'; |
| 553 | $filters['Osirusoft Smart Host']['dns'] = 'relays.osirusoft.com'; |
| 554 | $filters['Osirusoft Smart Host']['result'] = '127.0.0.5'; |
| 555 | $filters['Osirusoft Smart Host']['comment'] = |
| 556 | _("FREE - Osirusoft Smart Hosts - List of hosts that are secure but relay for other mail servers that are not secure."); |
| 557 | |
| 558 | $filters['Osirusoft SPAMware']['prefname'] = 'filters_spam_maps_osirusoft_ss'; |
| 559 | $filters['Osirusoft SPAMware']['name'] = 'Osirusoft Spamware Developers List'; |
| 560 | $filters['Osirusoft SPAMware']['link'] = 'http://relays.osirusoft.com/'; |
| 561 | $filters['Osirusoft SPAMware']['dns'] = 'relays.osirusoft.com'; |
| 562 | $filters['Osirusoft SPAMware']['result'] = '127.0.0.6'; |
| 563 | $filters['Osirusoft SPAMware']['comment'] = |
| 564 | _("FREE - Osirusoft Spamware Developers - It is believed that these are IP ranges of companies that are known to produce spam software. Seems to catch abuse auto-replies from some ISPs."); |
| 565 | |
| 566 | $filters['Osirusoft Unc. OptIn']['prefname'] = 'filters_spam_maps_osirusoft_sl'; |
| 567 | $filters['Osirusoft Unc. OptIn']['name'] = 'Osirusoft Unconfirmed OptIn Server List'; |
| 568 | $filters['Osirusoft Unc. OptIn']['link'] = 'http://relays.osirusoft.com/'; |
| 569 | $filters['Osirusoft Unc. OptIn']['dns'] = 'relays.osirusoft.com'; |
| 570 | $filters['Osirusoft Unc. OptIn']['result'] = '127.0.0.7'; |
| 571 | $filters['Osirusoft Unc. OptIn']['comment'] = |
| 572 | _("FREE - Osirusoft Unconfirmed OptIn Servers - List of listservers that opt users in without confirmation."); |
| 573 | |
| 574 | $filters['Osirusoft Insecure Formmail']['prefname'] = 'filters_spam_maps_osirusoft_fm'; |
| 575 | $filters['Osirusoft Insecure Formmail']['name'] = 'Osirusoft Insecure formmail.cvi Script List'; |
| 576 | $filters['Osirusoft Insecure Formmail']['link'] = 'http://relays.osirusoft.com/'; |
| 577 | $filters['Osirusoft Insecure Formmail']['dns'] = 'relays.osirusoft.com'; |
| 578 | $filters['Osirusoft Insecure Formmail']['result'] = '127.0.0.8'; |
| 579 | $filters['Osirusoft Insecure Formmail']['comment'] = |
| 580 | _("FREE - Osirusoft Insecure formmail.cgi scripts - List of insecure formmail.cgi scripts. (planned)."); |
| 581 | |
| 582 | $filters['Osirusoft Open Proxy']['prefname'] = 'filters_spam_maps_osirusoft_op'; |
| 583 | $filters['Osirusoft Open Proxy']['name'] = 'Osirusoft Open Proxy Server List'; |
| 584 | $filters['Osirusoft Open Proxy']['link'] = 'http://relays.osirusoft.com/'; |
| 585 | $filters['Osirusoft Open Proxy']['dns'] = 'relays.osirusoft.com'; |
| 586 | $filters['Osirusoft Open Proxy']['result'] = '127.0.0.9'; |
| 587 | $filters['Osirusoft Open Proxy']['comment'] = |
| 588 | _("FREE - Osirusoft Open Proxy Servers - List of Open Proxy Servers."); |
| 589 | |
| 590 | $filters['ORDB']['prefname'] = 'filters_spam_ordb'; |
| 591 | $filters['ORDB']['name'] = 'Open Relay Database List'; |
| 592 | $filters['ORDB']['link'] = 'http://www.ordb.org/'; |
| 593 | $filters['ORDB']['dns'] = 'relays.ordb.org'; |
| 594 | $filters['ORDB']['result'] = '127.0.0.2'; |
| 595 | $filters['ORDB']['comment'] = |
| 596 | _("FREE - ORDB was born when ORBS went off the air. It seems to have fewer false positives than ORBS did though."); |
| 597 | |
| 598 | $filters['FiveTen Direct']['prefname'] = 'filters_spam_fiveten_src'; |
| 599 | $filters['FiveTen Direct']['name'] = 'Five-Ten-sg.com Direct SPAM Sources'; |
| 600 | $filters['FiveTen Direct']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 601 | $filters['FiveTen Direct']['dns'] = 'blackholes.five-ten-sg.com'; |
| 602 | $filters['FiveTen Direct']['result'] = '127.0.0.2'; |
| 603 | $filters['FiveTen Direct']['comment'] = |
| 604 | _("FREE - Five-Ten-sg.com - Direct SPAM sources."); |
| 605 | |
| 606 | $filters['FiveTen DUL']['prefname'] = 'filters_spam_fiveten_dul'; |
| 607 | $filters['FiveTen DUL']['name'] = 'Five-Ten-sg.com DUL Lists'; |
| 608 | $filters['FiveTen DUL']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 609 | $filters['FiveTen DUL']['dns'] = 'blackholes.five-ten-sg.com'; |
| 610 | $filters['FiveTen DUL']['result'] = '127.0.0.3'; |
| 611 | $filters['FiveTen DUL']['comment'] = |
| 612 | _("FREE - Five-Ten-sg.com - Dial-up lists - includes some DSL IPs."); |
| 613 | |
| 614 | $filters['FiveTen Unc. OptIn']['prefname'] = 'filters_spam_fiveten_oi'; |
| 615 | $filters['FiveTen Unc. OptIn']['name'] = 'Five-Ten-sg.com Unconfirmed OptIn Lists'; |
| 616 | $filters['FiveTen Unc. OptIn']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 617 | $filters['FiveTen Unc. OptIn']['dns'] = 'blackholes.five-ten-sg.com'; |
| 618 | $filters['FiveTen Unc. OptIn']['result'] = '127.0.0.4'; |
| 619 | $filters['FiveTen Unc. OptIn']['comment'] = |
| 620 | _("FREE - Five-Ten-sg.com - Bulk mailers that do not use confirmed opt-in."); |
| 621 | |
| 622 | $filters['FiveTen Others']['prefname'] = 'filters_spam_fiveten_oth'; |
| 623 | $filters['FiveTen Others']['name'] = 'Five-Ten-sg.com Other Misc. Servers'; |
| 624 | $filters['FiveTen Others']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 625 | $filters['FiveTen Others']['dns'] = 'blackholes.five-ten-sg.com'; |
| 626 | $filters['FiveTen Others']['result'] = '127.0.0.5'; |
| 627 | $filters['FiveTen Others']['comment'] = |
| 628 | _("FREE - Five-Ten-sg.com - Other misc. servers."); |
| 629 | |
| 630 | $filters['FiveTen Single Stage']['prefname'] = 'filters_spam_fiveten_ss'; |
| 631 | $filters['FiveTen Single Stage']['name'] = 'Five-Ten-sg.com Single Stage Servers'; |
| 632 | $filters['FiveTen Single Stage']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 633 | $filters['FiveTen Single Stage']['dns'] = 'blackholes.five-ten-sg.com'; |
| 634 | $filters['FiveTen Single Stage']['result'] = '127.0.0.6'; |
| 635 | $filters['FiveTen Single Stage']['comment'] = |
| 636 | _("FREE - Five-Ten-sg.com - Single Stage servers."); |
| 637 | |
| 638 | $filters['FiveTen SPAM Support']['prefname'] = 'filters_spam_fiveten_supp'; |
| 639 | $filters['FiveTen SPAM Support']['name'] = 'Five-Ten-sg.com SPAM Support Servers'; |
| 640 | $filters['FiveTen SPAM Support']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 641 | $filters['FiveTen SPAM Support']['dns'] = 'blackholes.five-ten-sg.com'; |
| 642 | $filters['FiveTen SPAM Support']['result'] = '127.0.0.7'; |
| 643 | $filters['FiveTen SPAM Support']['comment'] = |
| 644 | _("FREE - Five-Ten-sg.com - SPAM Support servers."); |
| 645 | |
| 646 | $filters['FiveTen Web forms']['prefname'] = 'filters_spam_fiveten_wf'; |
| 647 | $filters['FiveTen Web forms']['name'] = 'Five-Ten-sg.com Web Form IPs'; |
| 648 | $filters['FiveTen Web forms']['link'] = 'http://www.five-ten-sg.com/blackhole.php'; |
| 649 | $filters['FiveTen Web forms']['dns'] = 'blackholes.five-ten-sg.com'; |
| 650 | $filters['FiveTen Web forms']['result'] = '127.0.0.8'; |
| 651 | $filters['FiveTen Web forms']['comment'] = |
| 652 | _("FREE - Five-Ten-sg.com - Web Form IPs."); |
| 653 | |
| 654 | $filters['Dorkslayers']['prefname'] = 'filters_spam_dorks'; |
| 655 | $filters['Dorkslayers']['name'] = 'Dorkslayers Lists'; |
| 656 | $filters['Dorkslayers']['link'] = 'http://www.dorkslayers.com'; |
| 657 | $filters['Dorkslayers']['dns'] = 'orbs.dorkslayers.com'; |
| 658 | $filters['Dorkslayers']['result'] = '127.0.0.2'; |
| 659 | $filters['Dorkslayers']['comment'] = |
| 660 | _("FREE - Dorkslayers appears to include only really bad open relays outside the US to avoid being sued. Interestingly enough, their website recommends you NOT use their service."); |
| 661 | |
| 662 | $filters['SPAMhaus']['prefname'] = 'filters_spam_spamhaus'; |
| 663 | $filters['SPAMhaus']['name'] = 'SPAMhaus Lists'; |
| 664 | $filters['SPAMhaus']['link'] = 'http://www.spamhaus.org'; |
| 665 | $filters['SPAMhaus']['dns'] = 'sbl.spamhaus.org'; |
| 666 | $filters['SPAMhaus']['result'] = '127.0.0.6'; |
| 667 | $filters['SPAMhaus']['comment'] = |
| 668 | _("FREE - SPAMhaus - A list of well-known SPAM sources."); |
| 669 | |
| 670 | $filters['SPAMcop']['prefname'] = 'filters_spam_spamcop'; |
| 671 | $filters['SPAMcop']['name'] = 'SPAM Cop Lists'; |
| 672 | $filters['SPAMcop']['link'] = 'http://spamcop.net/bl.shtml'; |
| 673 | $filters['SPAMcop']['dns'] = 'bl.spamcop.net'; |
| 674 | $filters['SPAMcop']['result'] = '127.0.0.2'; |
| 675 | $filters['SPAMcop']['comment'] = |
| 676 | _("FREE, for now - SPAMCOP - An interesting solution that lists servers that have a very high spam to legit email ratio (85% or more)."); |
| 677 | |
| 678 | $filters['dev.null.dk']['prefname'] = 'filters_spam_devnull'; |
| 679 | $filters['dev.null.dk']['name'] = 'dev.null.dk Lists'; |
| 680 | $filters['dev.null.dk']['link'] = 'http://dev.null.dk/'; |
| 681 | $filters['dev.null.dk']['dns'] = 'dev.null.dk'; |
| 682 | $filters['dev.null.dk']['result'] = '127.0.0.2'; |
| 683 | $filters['dev.null.dk']['comment'] = |
| 684 | _("FREE - dev.null.dk - I don't have any detailed info on this list."); |
| 685 | |
| 686 | $filters['visi.com']['prefname'] = 'filters_spam_visi'; |
| 687 | $filters['visi.com']['name'] = 'visi.com Relay Stop List'; |
| 688 | $filters['visi.com']['link'] = 'http://relays.visi.com'; |
| 689 | $filters['visi.com']['dns'] = 'relays.visi.com'; |
| 690 | $filters['visi.com']['result'] = '127.0.0.2'; |
| 691 | $filters['visi.com']['comment'] = |
| 692 | _("FREE - visi.com - Relay Stop List. Very conservative OpenRelay List."); |
| 693 | |
| 694 | $filters['2mbit.com Open Relays']['prefname'] = 'filters_spam_2mb_or'; |
| 695 | $filters['2mbit.com Open Relays']['name'] = '2mbit.com Open Relays List'; |
| 696 | $filters['2mbit.com Open Relays']['link'] = 'http://www.2mbit.com/sbl.php'; |
| 697 | $filters['2mbit.com Open Relays']['dns'] = 'blackholes.2mbit.com'; |
| 698 | $filters['2mbit.com Open Relays']['result'] = '127.0.0.2'; |
| 699 | $filters['2mbit.com Open Relays']['comment'] = |
| 700 | _("FREE - 2mbit.com Open Relays - Another list of Open Relays."); |
| 701 | |
| 702 | $filters['2mbit.com SPAM Source']['prefname'] = 'filters_spam_2mb_ss'; |
| 703 | $filters['2mbit.com SPAM Source']['name'] = '2mbit.com SPAM Source List'; |
| 704 | $filters['2mbit.com SPAM Source']['link'] = 'http://www.2mbit.com/sbl.php'; |
| 705 | $filters['2mbit.com SPAM Source']['dns'] = 'blackholes.2mbit.com'; |
| 706 | $filters['2mbit.com SPAM Source']['result'] = '127.0.0.4'; |
| 707 | $filters['2mbit.com SPAM Source']['comment'] = |
| 708 | _("FREE - 2mbit.com SPAM Source - List of Direct SPAM Sources."); |
| 709 | |
| 710 | $filters['2mbit.com SPAM ISPs']['prefname'] = 'filters_spam_2mb_isp'; |
| 711 | $filters['2mbit.com SPAM ISPs']['name'] = '2mbit.com SPAM-friendly ISP List'; |
| 712 | $filters['2mbit.com SPAM ISPs']['link'] = 'http://www.2mbit.com/sbl.php'; |
| 713 | $filters['2mbit.com SPAM ISPs']['dns'] = 'blackholes.2mbit.com'; |
| 714 | $filters['2mbit.com SPAM ISPs']['result'] = '127.0.0.10'; |
| 715 | $filters['2mbit.com SPAM ISPs']['comment'] = |
| 716 | _("FREE - 2mbit.com SPAM ISPs - List of SPAM-friendly ISPs."); |
| 717 | |
| 718 | $filters['Leadmon DUL']['prefname'] = 'filters_spam_lm_dul'; |
| 719 | $filters['Leadmon DUL']['name'] = 'Leadmon.net DUL List'; |
| 720 | $filters['Leadmon DUL']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 721 | $filters['Leadmon DUL']['dns'] = 'spamguard.leadmon.net'; |
| 722 | $filters['Leadmon DUL']['result'] = '127.0.0.2'; |
| 723 | $filters['Leadmon DUL']['comment'] = |
| 724 | _("FREE - Leadmon DUL - Another list of Dial-up or otherwise dynamically assigned IPs."); |
| 725 | |
| 726 | $filters['Leadmon SPAM Source']['prefname'] = 'filters_spam_lm_ss'; |
| 727 | $filters['Leadmon SPAM Source']['name'] = 'Leadmon.net SPAM Source List'; |
| 728 | $filters['Leadmon SPAM Source']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 729 | $filters['Leadmon SPAM Source']['dns'] = 'spamguard.leadmon.net'; |
| 730 | $filters['Leadmon SPAM Source']['result'] = '127.0.0.3'; |
| 731 | $filters['Leadmon SPAM Source']['comment'] = |
| 732 | _("FREE - Leadmon SPAM Source - List of IPs Leadmon.net has received SPAM directly from."); |
| 733 | |
| 734 | $filters['Leadmon Bulk Mailers']['prefname'] = 'filters_spam_lm_bm'; |
| 735 | $filters['Leadmon Bulk Mailers']['name'] = 'Leadmon.net Bulk Mailers List'; |
| 736 | $filters['Leadmon Bulk Mailers']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 737 | $filters['Leadmon Bulk Mailers']['dns'] = 'spamguard.leadmon.net'; |
| 738 | $filters['Leadmon Bulk Mailers']['result'] = '127.0.0.4'; |
| 739 | $filters['Leadmon Bulk Mailers']['comment'] = |
| 740 | _("FREE - Leadmon Bulk Mailers - Bulk mailers that do not require confirmed opt-in or that have allowed known spammers to become clients and abuse their services."); |
| 741 | |
| 742 | $filters['Leadmon Open Relays']['prefname'] = 'filters_spam_lm_or'; |
| 743 | $filters['Leadmon Open Relays']['name'] = 'Leadmon.net Open Relays List'; |
| 744 | $filters['Leadmon Open Relays']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 745 | $filters['Leadmon Open Relays']['dns'] = 'spamguard.leadmon.net'; |
| 746 | $filters['Leadmon Open Relays']['result'] = '127.0.0.5'; |
| 747 | $filters['Leadmon Open Relays']['comment'] = |
| 748 | _("FREE - Leadmon Open Relays - Single Stage Open Relays that are not listed on other active RBLs."); |
| 749 | |
| 750 | $filters['Leadmon Multi-stage']['prefname'] = 'filters_spam_lm_ms'; |
| 751 | $filters['Leadmon Multi-stage']['name'] = 'Leadmon.net Multi-Stage Relay List'; |
| 752 | $filters['Leadmon Multi-stage']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 753 | $filters['Leadmon Multi-stage']['dns'] = 'spamguard.leadmon.net'; |
| 754 | $filters['Leadmon Multi-stage']['result'] = '127.0.0.6'; |
| 755 | $filters['Leadmon Multi-stage']['comment'] = |
| 756 | _("FREE - Leadmon Multi-stage - Multi-Stage Open Relays that are not listed on other active RBLs and that have sent SPAM to Leadmon.net."); |
| 757 | |
| 758 | $filters['Leadmon SpamBlock']['prefname'] = 'filters_spam_lm_sb'; |
| 759 | $filters['Leadmon SpamBlock']['name'] = 'Leadmon.net SpamBlock Sites List'; |
| 760 | $filters['Leadmon SpamBlock']['link'] = 'http://www.leadmon.net/spamguard/'; |
| 761 | $filters['Leadmon SpamBlock']['dns'] = 'spamguard.leadmon.net'; |
| 762 | $filters['Leadmon SpamBlock']['result'] = '127.0.0.7'; |
| 763 | $filters['Leadmon SpamBlock']['comment'] = |
| 764 | _("FREE - Leadmon SpamBlock - Sites on this listing have sent Leadmon.net direct SPAM from IPs in netblocks where the entire block has no DNS mappings. It's a list of BLOCKS of IPs being used by people who have SPAMmed Leadmon.net."); |
| 765 | |
| 766 | $filters['NJABL Open Relays']['prefname'] = 'filters_spam_njabl_or'; |
| 767 | $filters['NJABL Open Relays']['name'] = 'NJABL Open Relay/Direct Spam Source List'; |
| 768 | $filters['NJABL Open Relays']['link'] = 'http://www.njabl.org/'; |
| 769 | $filters['NJABL Open Relays']['dns'] = 'dnsbl.njabl.org'; |
| 770 | $filters['NJABL Open Relays']['result'] = '127.0.0.2'; |
| 771 | $filters['NJABL Open Relays']['comment'] = |
| 772 | _("FREE, for now - Not Just Another Blacklist - Both Open Relays and Direct SPAM Sources."); |
| 773 | |
| 774 | $filters['NJABL DUL']['prefname'] = 'filters_spam_njabl_dul'; |
| 775 | $filters['NJABL DUL']['name'] = 'NJABL Dial-ups List'; |
| 776 | $filters['NJABL DUL']['link'] = 'http://www.njabl.org/'; |
| 777 | $filters['NJABL DUL']['dns'] = 'dnsbl.njabl.org'; |
| 778 | $filters['NJABL DUL']['result'] = '127.0.0.3'; |
| 779 | $filters['NJABL DUL']['comment'] = |
| 780 | _("FREE, for now - Not Just Another Blacklist - Dial-up IPs."); |
| 781 | |
| 782 | $filters['Conf DSBL.ORG Relay']['prefname'] = 'filters_spam_dsbl_conf_ss'; |
| 783 | $filters['Conf DSBL.ORG Relay']['name'] = 'DSBL.org Confirmed Relay List'; |
| 784 | $filters['Conf DSBL.ORG Relay']['link'] = 'http://www.dsbl.org/'; |
| 785 | $filters['Conf DSBL.ORG Relay']['dns'] = 'list.dsbl.org'; |
| 786 | $filters['Conf DSBL.ORG Relay']['result'] = '127.0.0.2'; |
| 787 | $filters['Conf DSBL.ORG Relay']['comment'] = |
| 788 | _("FREE - Distributed Sender Boycott List - Confirmed Relays"); |
| 789 | |
| 790 | $filters['Conf DSBL.ORG Multi-Stage']['prefname'] = 'filters_spam_dsbl_conf_ms'; |
| 791 | $filters['Conf DSBL.ORG Multi-Stage']['name'] = 'DSBL.org Confirmed Multi-Stage Relay List'; |
| 792 | $filters['Conf DSBL.ORG Multi-Stage']['link'] = 'http://www.dsbl.org/'; |
| 793 | $filters['Conf DSBL.ORG Multi-Stage']['dns'] = 'multihop.dsbl.org'; |
| 794 | $filters['Conf DSBL.ORG Multi-Stage']['result'] = '127.0.0.2'; |
| 795 | $filters['Conf DSBL.ORG Multi-Stage']['comment'] = |
| 796 | _("FREE - Distributed Sender Boycott List - Confirmed Multi-stage Relays"); |
| 797 | |
| 798 | $filters['UN-Conf DSBL.ORG']['prefname'] = 'filters_spam_dsbl_unc'; |
| 799 | $filters['UN-Conf DSBL.ORG']['name'] = 'DSBL.org UN-Confirmed Relay List'; |
| 800 | $filters['UN-Conf DSBL.ORG']['link'] = 'http://www.dsbl.org/'; |
| 801 | $filters['UN-Conf DSBL.ORG']['dns'] = 'unconfirmed.dsbl.org'; |
| 802 | $filters['UN-Conf DSBL.ORG']['result'] = '127.0.0.2'; |
| 803 | $filters['UN-Conf DSBL.ORG']['comment'] = |
| 804 | _("FREE - Distributed Sender Boycott List - UN-Confirmed Relays"); |
| 805 | |
| 806 | foreach ($filters as $Key => $Value) { |
| 807 | $filters[$Key]['enabled'] = getPref($data_dir, $username, |
| 808 | $filters[$Key]['prefname']); |
| 809 | } |
| 810 | |
| 811 | return $filters; |
| 812 | } |
| 813 | |
| 814 | function remove_filter ($id) { |
| 815 | global $data_dir, $username; |
| 816 | |
| 817 | while ($nextFilter = getPref($data_dir, $username, 'filter' . |
| 818 | ($id + 1))) { |
| 819 | setPref($data_dir, $username, 'filter' . $id, $nextFilter); |
| 820 | $id ++; |
| 821 | } |
| 822 | |
| 823 | removePref($data_dir, $username, 'filter' . $id); |
| 824 | } |
| 825 | |
| 826 | function filter_swap($id1, $id2) { |
| 827 | global $data_dir, $username; |
| 828 | |
| 829 | $FirstFilter = getPref($data_dir, $username, 'filter' . $id1); |
| 830 | $SecondFilter = getPref($data_dir, $username, 'filter' . $id2); |
| 831 | |
| 832 | if ($FirstFilter && $SecondFilter) { |
| 833 | setPref($data_dir, $username, 'filter' . $id2, $FirstFilter); |
| 834 | setPref($data_dir, $username, 'filter' . $id1, $SecondFilter); |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | /* This update the filter rules when |
| 839 | renaming or deleting folders */ |
| 840 | function update_for_folder ($args) { |
| 841 | $old_folder = $args[0]; |
| 842 | $new_folder = $args[2]; |
| 843 | $action = $args[1]; |
| 844 | global $plugins, $data_dir, $username; |
| 845 | $filters = array(); |
| 846 | $filters = load_filters(); |
| 847 | $filter_count = count($filters); |
| 848 | $p = 0; |
| 849 | for ($i=0;$i<$filter_count;$i++) { |
| 850 | if (!empty($filters)) { |
| 851 | if ($old_folder == $filters[$i]['folder']) { |
| 852 | if ($action == 'rename') { |
| 853 | $filters[$i]['folder'] = $new_folder; |
| 854 | setPref($data_dir, $username, 'filter'.$i, |
| 855 | $filters[$i]['where'].','.$filters[$i]['what'].','.$new_folder); |
| 856 | } |
| 857 | elseif ($action == 'delete') { |
| 858 | remove_filter($p); |
| 859 | $p = $p-1; |
| 860 | } |
| 861 | } |
| 862 | $p++; |
| 863 | } |
| 864 | } |
| 865 | } |
| 866 | ?> |