https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6458
--- Comment #3 from Mark Martinec <[email protected]> 2010-06-28 19:35:05 EDT --- > Amazing stuff! > blacklist_uri_host ru cn kr Now this brings up some ideas for added flexibility. A hard-core blacklisting with a very high score may not suit every need, it would be nice to be able to associate a score with a list of 'not-so-black'-listed URI domains. The following change implements just that: instead of a single black (or white) list, it allows one to form any number of named lists of URI hosts, and associate a score with each list. Example 1: enlist_uri_host (LOW) geocities.com enlist_uri_host (MED) geocities.yahoo.com.br enlist_uri_host (LOW) AutoFinanceUK.co.uk enlist_uri_host (HIGH) blasdutro buckrea.com enlist_uri_host (MED) True.com enlist_uri_host (LOW) imageshack.us and the corresponding rules: header URI_HOST_LOW eval:check_uri_host_listed('LOW') describe URI_HOST_LOW Host or domain found in URI is listed in the LOW list tflags URI_HOST_LOW userconf noautolearn score URI_HOST_LOW 1.5 header URI_HOST_MED eval:check_uri_host_listed('MED') describe URI_HOST_MED Host or domain found in URI is listed in the MED list tflags URI_HOST_MED userconf noautolearn score URI_HOST_MED 4 header URI_HOST_HIGH eval:check_uri_host_listed('HIGH') describe URI_HOST_HIGH Host or domain found in URI is listed in the HIGH list tflags URI_HOST_HIGH userconf noautolearn score URI_HOST_HIGH 12 Example 2: blacklist_uri_host www.need-lust.com www.crave-lust blacklist_uri_host sommerphantasie.com klick2go.com lucymeier.com blacklist_uri_host www.replaceftpsmtp.com www.aectransfer.org blacklist_uri_host epsore.com www.alveal.com blacklist_uri_host reppsetinte.com preprotissit.com blacklist_uri_host www.weinportale.de www.fasctvideos.cn blacklist_uri_host www.dilcasino.com www.hotgoldgambling.net blacklist_uri_host www.antos.si www.omegaic.net www.clickonevent.com blacklist_uri_host www.exorcism.org www.eturning.com www.piramidasunca.ba blacklist_uri_host 64.15.147.100 blacklist_uri_host bot.tormaxusa.net www.qtechna.si www.clecle.si blacklist_uri_host www.ninadesign.co.nr constructionfiles.net aecfiles02.com blacklist_uri_host filetransfer00.com filetransfer01.com filetransfer02.com blacklist_uri_host filetransfer03.com filetransfer04.com filetransfer05.com blacklist_uri_host filetransfer06.com filetransfer07.com filetransfer08.com blacklist_uri_host filetransfer09.com header URI_HOST_IN_BLACKLIST eval:check_uri_host_listed('BLACK') describe URI_HOST_IN_BLACKLIST Host or domain found in URI is blacklisted tflags URI_HOST_IN_BLACKLIST userconf noautolearn score URI_HOST_IN_BLACKLIST 8 header URI_HOST_IN_WHITELIST eval:check_uri_host_listed('WHITE') describe URI_HOST_IN_WHITELIST Host or domain found in URI is blacklisted tflags URI_HOST_IN_WHITELIST userconf nice noautolearn score URI_HOST_IN_WHITELIST -10 Example 3: enlist_uri_host (RCKT) ru !aaa.example.kr cn kr tr header URI_HOST_RCKT eval:check_uri_host_listed('RCKT') score URI_HOST_RCKT 0.1 enlist_uri_host (RU) ru header URI_HOST_RU eval:check_uri_host_listed('RU') score URI_HOST_RU 1.8 enlist_uri_host (CN) cn header URI_HOST_CN eval:check_uri_host_listed('CN') score URI_HOST_CN 1.2 enlist_uri_host (KR) kr header URI_HOST_KR eval:check_uri_host_listed('KR') score URI_HOST_KR 1.5 enlist_uri_host (TR) tr header URI_HOST_TR eval:check_uri_host_listed('TR') score URI_HOST_TR 1.5 Here is the corresponding (changed/added) documentation: =item enlist_uri_host (listname) host ... Adds one or more host names or domain names to a named list of URI domains. The named list can then be consulted through a check_uri_host_in_wblist() eval rule, which takes the list name as an argument. Parenthesis around a list name are literal - a required syntax. Host names may optionally be prefixed by an exclamantion mark '!', which produces false as a result if this entry matches. This makes it easier to exclude some subdomains when their superdomain is listed, for example: enlist_uri_host (MYLIST) !sub1.example.com !sub2.example.com example.com No wildcards are supported, but subdomains do match implicitly. Lists are independent. Search for each named list starts by looking up the full hostname first, then leading fields are progressively stripped off (e.g.: sub.example.com, example.com, com) until a match is found or we run out of fields. The first matching entry (the most specific) determines if a lookup yielded a true (no '!' prefix) or a false ('!'-prefixed) result. If an URL found in a message contains an IP address in place of a host name, the given list must specify the exact same IP address (instead of a host name) in order to match. Use the delist_uri_host directive to neutralize previous enlist_uri_host settings. Listnames 'BLACK' and 'WHITE' have their shorthand directives blacklist_uri_host and whitelist_uri_host and default rules, but are otherwise not special or reserved. =item delist_uri_host [ (listname) ] host ... Removes one or more specified host names from a named list of URI domains. Removing an unlisted name is ignored (is not an error). Listname is optional, if specified then just the named list is affected, otherwise hosts are removed from all URI host lists created so far. Parenthesis around a list name are a required syntax. Note that directives in configuration files are processed in sequence, the delist_uri_host only applies to previously listed entries and has no effect on enlisted entries in yet-to-be-processed directives. For convenience (similarity to the enlist_uri_host directive) hostnames may be prefixed by a an exclamation mark, which is stripped off from each name and has no meaning here. =item blacklist_uri_host host-or-domain ... Is a shorthand for a directive: enlist_uri_host (BLACK) host ... Please see directives enlist_uri_host and delist_uri_host for details. =item whitelist_uri_host host-or-domain ... Is a shorthand for a directive: enlist_uri_host (BLACK) host ... Please see directives enlist_uri_host and delist_uri_host for details. trunk: Bug 6458 - add enlist_uri_host and delist_uri_host conf directives, allowing for arbitrarily named URI lists, each associated with its own scoring rule Sending lib/Mail/SpamAssassin/Conf.pm Sending lib/Mail/SpamAssassin/Plugin/WLBLEval.pm Committed revision 958790. -- Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
