1# Statistics setup 2# Please don't modify this file as your changes might be overwritten with 3# the next update. 4# 5# You can modify 'local.d/statistics.conf' to add and merge 6# parameters defined inside this section 7# 8# You can modify 'override.d/statistics.conf' to strictly override all 9# parameters defined inside this section 10# 11# If you just need to change the default bayes classifier, you can also use 12# 'local.d/classifier-bayes.conf' or 'override.d/classifier-bayes.conf'. But 13# never ever use both `statistics.conf` and `classifier-bayes.conf` locals files 14# together! 15# 16# See https://rspamd.com/doc/faq.html#what-are-the-locald-and-overrided-directories 17# for details 18# 19# Module documentation: https://rspamd.com/doc/configuration/statistic.html 20 21classifier "bayes" { 22 tokenizer { 23 name = "osb"; 24 } 25 cache { 26 } 27 new_schema = true; # Always use new schema 28 store_tokens = false; # Redefine if storing of tokens is desired 29 signatures = false; # Store learn signatures 30 #per_user = true; # Enable per user classifier 31 min_tokens = 11; 32 backend = "redis"; 33 min_learns = 200; 34 35 statfile { 36 symbol = "BAYES_HAM"; 37 spam = false; 38 } 39 statfile { 40 symbol = "BAYES_SPAM"; 41 spam = true; 42 } 43 learn_condition = 'return require("lua_bayes_learn").can_learn'; 44 45 # Autolearn sample 46 # autolearn { 47 # spam_threshold = 6.0; # When to learn spam (score >= threshold and action is reject) 48 # junk_threshold = 4.0; # When to learn spam (score >= threshold and action is rewrite subject or add header, and has two or more positive results) 49 # ham_threshold = -0.5; # When to learn ham (score <= threshold and action is no action, and score is negative or has three or more negative results) 50 # check_balance = true; # Check spam and ham balance 51 # min_balance = 0.9; # Keep diff for spam/ham learns for at least this value 52 #} 53 54 .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/classifier-bayes.conf" 55 .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/classifier-bayes.conf" 56} 57 58.include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/statistic.conf" 59.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/statistic.conf" 60