diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 70e5bbf10b5a0285064b07aa08a5143fc11453b2..57df2702e86abab7b9ce8afd13cd46a00e278ab6 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1337,6 +1337,18 @@ class installer_base { exec('cp tpl/rspamd_options.inc.master /etc/rspamd/local.d/options.inc'); } + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural.conf.master /etc/rspamd/local.d/neural.conf'); + } else { + exec('cp tpl/rspamd_neural.conf.master /etc/rspamd/local.d/neural.conf'); + } + + if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural_group.conf.master')) { + exec('cp '.$conf['ispconfig_install_dir'].'/server/conf-custom/install/rspamd_neural_group.conf.master /etc/rspamd/local.d/neural_group.conf'); + } else { + exec('cp tpl/rspamd_neural_group.conf.master /etc/rspamd/local.d/neural_group.conf'); + } + exec('chmod a+r /etc/rspamd/local.d/* /etc/rspamd/override.d/*'); $tpl = new tpl(); diff --git a/install/tpl/rspamd_neural.conf.master b/install/tpl/rspamd_neural.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..64b0fa8716211b2b57f0276881fb2bb076d77587 --- /dev/null +++ b/install/tpl/rspamd_neural.conf.master @@ -0,0 +1,31 @@ +servers = 127.0.0.1:6379; +enabled = true; + +rules { + "LONG" { + train { + max_trains = 5000; + max_usages = 200; + max_iterations = 25; + learning_rate = 0.01, + spam_score = 8; + ham_score = -2; + } + symbol_spam = "NEURAL_SPAM_LONG"; + symbol_ham = "NEURAL_HAM_LONG"; + ann_expire = 100d; + } + "SHORT" { + train { + max_trains = 100; + max_usages = 2; + max_iterations = 25; + learning_rate = 0.01, + spam_score = 8; + ham_score = -2; + } + symbol_spam = "NEURAL_SPAM_SHORT"; + symbol_ham = "NEURAL_HAM_SHORT"; + ann_expire = 1d; + } +} \ No newline at end of file diff --git a/install/tpl/rspamd_neural_group.conf.master b/install/tpl/rspamd_neural_group.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..c4f59c52e5c794ae3ab0cfede7f4a06705acf89d --- /dev/null +++ b/install/tpl/rspamd_neural_group.conf.master @@ -0,0 +1,18 @@ +symbols = { + "NEURAL_SPAM_LONG" { + weight = 3.0; # sample weight + description = "Neural network spam (long)"; + } + "NEURAL_HAM_LONG" { + weight = -3.0; # sample weight + description = "Neural network ham (long)"; + } + "NEURAL_SPAM_SHORT" { + weight = 2.0; # sample weight + description = "Neural network spam (short)"; + } + "NEURAL_HAM_SHORT" { + weight = -1.0; # sample weight + description = "Neural network ham (short)"; + } +}