/* * charybdis: an advanced ircd. * spamfilter.conf.example: An example extensions/spamfilter configuration * * Copyright (C) 2016 Jason Volk */ loadmodule "extensions/spamfilter"; loadmodule "extensions/spamfilter_nicks"; loadmodule "extensions/spamfilter_expr"; /* The spamfiler block contains general configuration lines for spamfilter.so, */ spamfilter { /* This message is sent when any spam filter is triggered. The variables ${network-name} * and ${admin-email} are substituted for your configured values. */ reject_reason = "Spam is off-topic on ${network-name}. If this is an error, please contact ${admin-email}"; }; /* The spamfiler_expr block contains general configuration for spamfilter_expr.so * Note: If you change these settings and rehash, they may not be applied to existing * expressions. You may have to reload the module. */ spamfilter_expr { /* Maximum number of regular expressions allowed */ limit = 1024; /* List of PCRE2 compile options added by default to all expressions. * See PCRE2_COMPILE(3) for a complete list. You omit the PCRE2_ prefix for this list. */ compile_opts = caseless; /* List of PCRE2 match (execution) options added by default to all expressions. * See PCRE2_MATCH(3) for a complete list. You omit the PCRE2_ prefix for this list. */ match_opts = noteol, notbol; /* List of PCRE2 JIT options added by default to all expressions. * See PCRE2JIT(3) and PCRE2API(3) for details. * You omit the PCRE2_JIT_ prefix for this list. */ jit_opts = complete; /* * You ought to know what you're doing with these. */ match_limit = 512; recursion_limit = 512; parens_nest_limit = 32; /* The starting size of the allocated JIT stack. */ jit_stack_size = 262144; /* The maximum size of the allocated JIT stack. * (This may take precedence over previous options as the limiting recursion factor) */ jit_stack_max_size = 393216; }; /* spamexpr blocks allow expressions to be configured offline. * There may be multiple spamexpr blocks, each must have a pattern. */ spamexpr { /* The regular expression pattern string. You will have to double-escape * any backslash to have a single backslash in the expression, thus triple-escape * any backslash to have an escape in the expression string itself! */ pattern = "foobar.+\\s"; /* Compile options specific to this pattern. This is or'ed with the compile_opts * specified in the general spamfilter_expr block. The rules are the same. */ compile_opts = caseless; }; spamexpr { pattern = "foo.*bar"; }; /* * The spamfiler_nicks block contains general configuration for spamfilter_nicks.so */ spamfilter_nicks { /* Number of nicknames in a message to trigger the nickspam filter. */ limit = 5; /* Minimum length of a word considered a nickname candidate. */ nicklen_min = 4; /* Size in bytes for the nickname bloom filter. */ bloom_size = 65536; /* Number of hashing bits for the bloom filter (try log2 of the bloom_size unless you know better). */ bloom_bits = 16; /* Time interval for when the bloom filter is flushed to prevent false positives. */ bloom_refresh = 5 minutes; };