/usr/share/procmail-lib/pm-jaube-keywords.rc is in procmail-lib 1:2009.1202-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | # pm-jaube-keywords.rc -- Bare bones word list based UBE filter
#
# File id
#
# Copyright (C) 1997-2010 Jari Aalto
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details at
# <http://www.gnu.org/copyleft/gpl.html>.
#
# Warning
#
# Put all your UBE (aka spam) filters towards the _end_ of your
# ~/.procmailrc. The idea is that valid messages are filed
# first (mailing lists, your work and private mail, bounces) and only
# the uncategorized messages are checked.
#
# Now, if 50-70 % hit rate is good enough for your starting point,
# go ahead and read more. This file is supposed to be the last resort,
# if you really do not have any better tool to analyze messages.
#
# Overview of features
#
# o Word and phrase based matching
# o 50-70 % success rate. 90 % never achieved. That's a guarantee.
# o Extremely fast and a dream to CPU resources. Implemented in pure
# procmail and you can almost hear the humming sound of its
# regular expression engine shredding UBE messages to pieces.
#
# Description
#
# Are you sure you want use this word list based checking?
#
# Think twice before you use this subroutine. It knows nothing about
# the content your mail. "It's all UBE unless proven otherwise" is the
# motto. The brutal search tracks words and phrases to find an indication
# of mass posting and traces of Unsolicited Bulk Email (UBE aka spam).
# _Repeat:_ Read the first paragraph again before you consider putting
# this file into action. This filter WILL PASS through unwanted mail
# and it WILL catch good mail. This is rule based matching, so I suppose
# you know where you're putting your head with this. Ahem. Alerted? Good.
#
# The Story
#
# There was a man and mail account. The account had limited space,
# couldn't install any other programs because disk quota would have
# exceeded. System administrators weren't' interested in installing
# anything. The Mail server ran behind firewall and had OS that was
# never heard of - it couldn't run other programs. Or if it could,
# the Bad system administrator was too scared to install extra
# programs to the host MTA ran. No joy -- no means to stop incoming
# UBE -- Right?
#
# Wrong. There was procmail. The Bad system adminitrator didn't mention
# that `~/.procmailrc' was honored - just the the external programs
# we a no-no-no (Technical: the MDA host mounted user disks; the
# server ran on separate host and couldn't use any of the user
# compiled programs. Statically linked ones filled up the man's disk
# space).
#
# First line of defense, any defense would do. So, this rule based
# file was born. Nothing else was installed in that account and the
# happy word list based matching routine kept chewing mail, mail,
# mail. And the system administrator was happy - he nurtured the MTA
# host's CPU resources and noticed nothing alarming. All ticked like
# clockwork.
#
# Life began again. After 1000 mail bombards a day, the account was
# usable again.
#
# Motivation
#
# If you can, use the Bayesian filters and forget all rule based
# ones, word and phrase matching based ones; all static filters. On
# the other hand, if you want quick solution, even imperfect, until
# you have time to learn and setup other tools, this subroutine may
# be of interest.
#
# The best part. You can carry this single file anywhere where procmail
# lives. No other files are needed. Setup couldn't be simpler.
#
# About bouncing message back
#
# The general consensus is, that you should not send bounces. The UBE
# sender is not there, because the address is usually forged. Do not
# increase the network traffic. Instead save the messages to folders
# and periodically check their contents. It's not nice to be forced to
# apologize about bounces to a wrong destination.
#
# Code Note
#
# Procmail is picky about the whitespace in continuing lines, make sure
# there is _not_ a single spaces left after the continuation backslash.
# Use good editors or external programs to get rid of the white spaces. In
# Emacs you would add this line to your `~/.emacs' startup file:
# "(add-hook 'write-file-hooks 'delete-trailing-whitespace)"
#
# :0
# * ^Subject:.*(regexp\
# |and-more\
# |and-more\
# )
# {
# # Process it
# }
#
# Why are the regexps put into this file and not to a separate regexp
# file? Good question. It is possible to check message's content with
# external process, like `grep', to see if any matches are found.
# This kind of methodology is covered in Procmail Tips section
# "Using grep with file lists to mach messages" at
# <http://pm-tips.sf.net>. The reason why all the regexp are maintained
# inside this file is:
#
# o Simplicity. One file - no extra configuration files or regexp
# databases.
# o Self standing. Does not call external processes, so it's a little
# faster than possible `grep' and `fgrep' solution.
#
# Required settings
#
# None. No dependencies to other procmail modules.
#
# Call arguments (variables to set before calling)
#
# o JA_UBE_KEYWORD_HEADER, if set, then the results are put to
# messages headers. By default this variable is not defined
# to save from external `formail' process call.
# Suggestion: "X-Spam-JaubeKwd"; without trailing colon.
#
# Return values
#
# o `ERROR_STATUS' is set to word "Bad" otherwise empty.
# o `ERROR' is set to short descriptive word that indicate which
# rule was matched. Values: *Header-FromKeywords*,
# *Header-SubjectKeywords* and *Body-Keywords*
# o `ERROR_MATCH' is set to some words that happened to trigger
# UBE catch rule.
#
# Usage example
#
# PMSRC = "/path/to/procmail/lib"
# # Exclude these addresses from tests
# VALID_FROM = "(my@address.example.com|word@here.example.com)"
#
# :0
# *$ ! ^From:.*$VALID_FROM
# * ! FROM_DAEMON
# {
# INCLUDERC = $PMSRC/pm-jaube-keywords.rc
#
# # Variable "ERROR" is set if message was UBE
#
# :0 :
# * ! ERROR ?? ^^^^
# junk.ube.spool
# }
#
# File layout
#
# The layout of this file is managed by Emacs packages tinyprocmal.el
# and tinytab.el for the 4 tab text placement.
# See project http://freshmeat.net/projects/emacs-tiny-tools/
#
# Change Log
#
# None.
dummy = "
========================================================================
pm-jaube-keywords.rc: init:"
#######################################################################
#
# User configurable variables. Set these, before calling this
# module/subroutine.
#
#######################################################################
# Set to a empty to suppress external shell call to `formail'.
JA_UBE_KEYWORD_HEADER = ${JA_UBE_KEYWORD_HEADER:-"X-Spam-JaubeKwd"}
#######################################################################
#
# Private variables. Do not touch
#
#######################################################################
# Kill variables or set default values
ERROR
ERROR_MATCH
ERROR_STATUS
NL = "
"
LF = $NL # synonym, linefeed
CR = "
" # Carriage return
TAB = " " # \t character, you won't see it.
WSPC = " $TAB" # whitespace in procmail: space + tab
# These are the variables that you're likely to use in
# condition lines. Notice that there is Perl styles `s' variable
# for shorter name for most used SPC.
SPC = "[$WSPC]" # Regexp space/tab
NSPC = "[^$WSPC]" # Negation, non-whitespace
CHAR = "[^ $TAB$NL$CR]" # A character
# Whitespace with linefeed
# Note that in regexps, the character class is faster that OR.
# Refer to O'Reilly book "Mastering Regular Expressions"
#
# space + tab + dollar
#
# ( | |$) is slower than ([ ]|$)
SPCL = "($SPC|$|$CR)" # space or tab; linefeed; Carriage return
jaubeKwdLinebufOld = $LINEBUF
LINEBUF = 65535 # Increase
jaubeKwdVerboseOld = $VERBOSE # don't write log for these variables
VERBOSE = off
# German, Spanish and other languages
jaubeLanguage="(\
[a-z] (con|m[ae]s|para) [a-z]\
|\<aloha\
|\<bitte\>\
|\<arbeitet\
|\<bail[ae]\
|\<damen\
|\<ganz\
|\<herren\
|\<bestaetigung\
|\<contenidos\
|\<fabricamos\
|\<freundlichen\
|\<kontakte\
|\<seguridad\
|<\ihre\
|\<jetzt\
|\<keine?\>\
|\<kontakt\
|\<telefono\
|\<tenga\
|\<totalmente\
|\<trabaj\
|\<vacantes\
)"
# English words. These keywords must be strict, because they are used
# BOTH in header and body.
jaubeKeywords="(\
[0-9][0-9.]* +per +(month|year)\
|\<18th\>\
|\<accessor(y|ies)\
|\<acne\>\
|\<adult\>\
|\<advertis\
|\<adorn\
|\<a+n+a+l\
|\<aphrodi\
|\<affordable\
|\<at + no +charge\
|\<babe\>\
|bachelor\
|\<be\>.*\<(again|strong)\
|bedroom\
|bewitch\
|\<bitch(es)?\>\
|\<biz\>\
|\<blonde\>\
|\<bodyguard\
|\<bondage>\
|\<boob([sy]|ed)?\>\
|boyfriend\
|\<breast\
|\<brunette\
|\<bucks\>\
|business +on our\>.*\<site\>\
|\<call +[+]?[0-9][0-9]\
|\<call +(me|us)\>\
|\<cash\>\
|\<cable +tv\
|calsium\
|cartoon\
|cartridge\
|casino\
|celebrit\
|\<censor(ed)?\>\
|\<cheap(er|est)?\>\
|cholesterol\
|C[|i]+a[|]*1is\
|\<clinic\
|\<click +here\
|\<clits?\>\
|\<cocaine\
|\<cock\>\
|\<congrat\
|confiden(c|tial)\
|confrontation\
|consultation\
|\<cutie\
|\<credits?\>\
|\<cum(shots?)?\>\
|\<daughter\
|\<(dating|escort) +service\
|\<deal.*to.*\<you\
|\<dear.*(user|owner)\
|\<defensa\
|\<delight\
|\<dental\
|depressant\
|detective\
|\<diabet\
|\<dick\>\
|\<dildo\>\
|diploma\
|discreet\
|\<do +you +like\
|\<doctor\
|domestic\
|download.*today\
|dramatic\
|drugs\
|earnings\
|\<eighteen\
|erection\
|eroti[ck]\
|fair +exchange\
|exchange +rate\
|exquisite\
|\<fags\>\
|farmac[yo]\
|fashion\
|female\
|financ(e|ial)\
|filing.*quotes\
|\<films?\>\
|filthy\
|fitness\
|\<for .*your.*Needs\
|\<f+u+c+k\
|\<funds?\>\
|\<g+a+y+\>\
|get it for (just)?.*[$]\
|get +perfect.*your\
|get +(lucky|fucked)\
|Get +the +best\
|girls?\>\
|get +(a|for)? *free\
|\<granny\
|greetings\
|gouranga\
|h+a+r+d+c+o+r+e\
|herbalife\
|(hi|hello|hey)[.!?]* +(people|lucky)\
|\<hot\>\
|\<honey\>\
|horoscope\
|hurry +(now|fast)\
|\<job +offer\
|\<husband\
|\<illnes\
|\<income\
|\<in +bed\
|\<invest(ment)?\>\
|\<interest +rates\>?\
|\<iraq\
|just .*$d+.*days\
|\<jude\>\
|\<kenedy\
|laboratory\
|\<laden\>\
|\<lad(y|ies)\>\
|legislation\
|lesbian\
|\<libido\
|lifestyle\
|(limited|special|future)\>.*\<offer\
|\<li+m+i+t+e+d.*time\
|lingerie\
|\<lo+l+i+t+a+\
|\<lose +(some)? *(weight|pounds)\
|losing +it +all\
|\<low.*rate\
|\<loan\
|\<lott(o|ery)\>\
|madam\
|mafia\
|manhood\
|\<marine\<\
|masturbat\
|medic(a[lt]|in)\
|mexican\
|money\
|mortgage\
|movie\
|\<new.*<(video|dvd|cd)s?\>\
|nigeria\
|nipple\
|offer.*valid\
|offshore\
|<\oil\>\
|oppurtun\
|\<orgy\>\
|\<our +(company|product)\
|order +(soon|now|fast)\
|pain killer\
|paycheck\
|paying\
|\<partner\
|\<pence\
|\<penis\>\
|\<pharmae?c\
|\<poker\
|\<prank\
|\<pregnan\
|\<p[0o]+rn\
|\<polls?\>\
|\<profit\>\
|promotion\
|prostitute\
|\<puss(y|ies)\>\
|\<rape\>\
|\<rates +starting +at\
|\<realestate\
|refinance\
|regalis\
|(restaurant|food) +recipe\
|\<rich\>\
|robbery\
|\<rolex\
|\<sadd?am\
|sadomasokism\
|satellite.*\<(tv|dish)\>\
|\<(sav(ing|e)|buy|see|web).*\<(pills|meds|m +e +d +s)\>\
|\<scent\>\
|screensaver\
|\<sex\>\
|\<sin\>\
|since we've chatted\
|\<silver\
|\<singles\
|\<sir\>\
|\<s[i|]ze +(real[a-z|]+ +)*matters?\>\
|\<sluts?\>\
|sperm\
|stamina\
|stocks?\
|sydney\
|\<save .*[0-9]+ *%\
|\<(secretary|wom[ea]n|girl|nude|teen).*\<strip\
|sweetheart\
|\<tax\>\
|\<teeny?(ie)?s?\>\
|terrorist\
|\<trad(e|ing)\
|tobacco\
|\<try .* our\>\
|\<USD? *[$]\
|\<[$][0-9][0-9.,]*[0-9]\>\
|\<uncle\>\
|Unauthorized access.*paypal\
|u+n+d+e+r+a+g+e\
|update.*your.*(bank)\
|\<vegas\
|\<venture\>\
|\<v[1i@.,!:;?]a+[:]*g+[:]*r+[:]*a\
|\<v[^ ]+gra\>\
|v[i|]+aggar\
|\<vip\>.*visitor\
|view +my +profile\
|wanted you to hear about.*\<new\
|\<wanna\
|\<we +specialize\
|\<weight[ -]+loss\
|welcome +to +our\
|\<h[0o]usew[1i]f\
|\<webcam\
|\<women acting\
|\<wom[ae]n.*your.*area\
|\<your?\>.*\<(benefit|w[io]n|satisf|payment|pri[zc]e|need|loan)\
|\<your on\
|\<you're on\
|\<you search for something\
|\<your cr[a-z.]* (rating|record)\
|\<you can be\>.*\<(safe|secure)\
|\<youth\
|$jaubeLanguage\
)"
# Some regexps cannot be used, because they would easily match legimite mail:
#
# - "your.*address" would match
# Please confirm your XXX Forwarding Address
# - "charm" would match
# works like a charm...
#
# Notes:
# - Regalis, Cialis are viagra drugs
jaubeSubjectKeywordsOnly="(\
[?][?]\
|!!\
|(\$|USD) *[0-9][0-9.,]\
|\<(down|king).*size\
|\<(try|do).*<(it|now|today)\
|\<(offer|receive).* you\
|\<(china|korea|usa|europe|australia|r+u+s+i+a|ira[qn]|beijing|iraq)\
|\<(bush|clinton)\>\
|\<(tv|she|us|hi|heya?|hiya|hello|win|ink|pics?|yo)\>\
|\<action\
|\<advisor\
|\<aging\>\
|anytime\
|anywhere\
|attractive\
|\<are you\>\
|\<ass\>\
|\<award(ing)?\>\
|\<back +to\
|\<be +successful\
|\<believ\
|\<belowed\
|\<bid\
|\<[bm]illion\
|\<blowjob\
|\<bonus\>\
|\<breath\
|\<bringing\
|bulk_mailer\
|\<busines\
|\<buy\
|\<camera\
|\<candle\
|\<cds?\>\
|\<charge\
|\<che+a+[pt]\>\
|\<check.*\<out\>\
|\<child\>\
|\<ciao\
|\<cigar\
|\<cold\
|\<contact.*\<(bank)\
|\<coral\
|\<cost\
|\<coupon\
|\<dance\
|\<dear\>\
|\<(debt|debs)\>\
|\<density\
|\<deserve\
|\<diet\
|\<digital\
|\<discount\
|\<d[0o]llar\
|\<don't +be\
|doesn't.*\<(hurt)\
|\<dudes?\>\
|\<dvds?\>\
|\<dying\
|\<earn\
|effortless\
|eliminate\
|\<employ\
|\<enjoy\
|\<enlarge\
|\<expedition\
|find +out\
|fingering\
|\<free\>.*(website|download)\
|\<for\>.*\<you.*(order|self)\
|\<fortune\
|\<fountain\
|\<friend\
|\<fun\>\
|\<g[eo]t +some\
|\<gain\
|\<g[eo0]t\>.*\<(smart)\
|\<go.* for\
|\<gold\
|good +day\
|governor\
|\<got +it\
|\<gratis\
|\<guarant\
|\<health\
|\<hold +of\
|\<hope\
|\<h[0o]use\
|\<hussy\
|\<humble\
|\<instant\
|\<is your\>\
|\<judical\
|\<large\
|\<life\
|\<love\
|\<luck\
|\<make\>.*\<(her)\
|\<master\>\
|\<market\
|\<mastercard\
|\<mobile\
|\<more[!?]\
|\<movie\
|\<mp3\
|\<muscle\
|\<music\
|newsletter\
|\<now!? \
|\<nurtur\
|\<oil\>\
|\<online.*web\
|\<our\>\
|\<overnight\
|\<paid\>\
|\<pay\>\
|\<passi[o0]\
|\<pda\>\
|\<personal\
|\<phone\
|\<photo\
|\<picture\
|\<pills?\>\
|\<premier\
|\<prescri[pb]\
|\<pound\
|president\
|\<pretty\>\
|\<prices?\
|\<propagand\
|\<reciprocal\
|\<representative\
|\<refill\
|\<sales?\>\
|\<screensaver\
|\<see\>.*\<this\>.*(www|web|site|page)\
|\<sell\>\
|\<sensati\
|\<sense\
|\<she\>.*(happy|try|tried)\
|\<shop\
|\<sincer\
|\<sisters?\>\
|\<smok(e|ing)?\>\
|\<solicit\
|\<spend\>\
|\<spirit\
|\<stress\
|\<stock\
|\<summer\>\
|\<super\
|\<swallow\
|\<seeking.*assistance\
|\<target\
|\<thank +you\
|\<the +time\
|\<thin\
|thousand\
|\<time +to\
|\<today\
|\<toner\
|\<tons\>\
|\<travel\
|\<try\>\
|\<typing\
|\<ultimate\
|\<(university|college) .*(degree|diploma)\
|\<up +to\
|\<urgent\
|\<utmost\
|\<video\
|\<visitor\
|\<wash\
|\<watch\
|\<we +ship\
|\<we need your\
|\<weather\
|\<welcome\
|\<wife\
|\<wines?\>\
|\<wish\
|\<w[oi]n\>\
|\<wom[ae]n\
|\<work.*\<for\>\
|XXX\
|yellow +page\
|\<young\
|$jaubeKeywords\
)"
# Restore saved values
VERBOSE = $jaubeKwdVerboseOld
dummy="pm-jaube-keywords.rc: TEST Subject keywords"
:0
*$ ^Subject:.*\/$jaubeSubjectKeywordsOnly$CHAR*
{
ERROR = "Header-SubjectKeywords"
ERROR_MATCH = "$MATCH"
}
dummy = "pm-jaube-keywords.rc: TEST Header From keywords"
:0
*$ ^From.*()\/$jaubeKeywords$CHAR*
{
ERROR_MATCH = "$MATCH"
:0
* ERROR ?? ^^^^
{
ERROR = "Header-FromKeywords"
}
:0 E
{
ERROR = "$ERROR:Header-FromKeywords"
}
}
dummy = "pm-jaube-keywords.rc: TEST body keywords"
:0
*$ B ?? ()\/$jaubeKeywords$CHAR*
{
ERROR_MATCH = "$MATCH"
:0
* ERROR ?? ^^^^
{
ERROR = "Body-Keywords"
}
:0 E
{
ERROR = "$ERROR:Body-Keywords"
}
}
:0
* ! ERROR ?? ^^^^
{
ERROR_STATUS = "Bad"
# strip leading and trailing whitespace.
:0
* ERROR_MATCH ?? ^^[$WSPC]
* ERROR_MATCH ?? ()\/[^$WSPC].*[^$WSPC]
{
ERROR_MATCH = "$MATCH"
}
:0
* ! JA_UBE_KEYWORD_HEADER ?? ^^^^
{
jaubeKwdInfo = "$ERROR $ERROR_MATCH"
jaubeKwdHeader = "$ERROR_STATUS $jaubeKwdInfo"
:0 fw
| ${FORMAIL:-"formail"} \
-I "$JA_UBE_KEYWORD_HEADER: $jaubeKwdHeader"
}
}
LINEBUF = $jaubeKwdLinebufOld
dummy = "pm-jaube-keywords.rc: end: $ERROR_STATUS $ERROR"
# pm-jaube.rc ends here
|