[Rspamd, Dovecot] Do not use Schaal rules - probably too much for Rspamd 2.x to handle, mem leak?

This commit is contained in:
andryyy 2019-10-31 20:43:07 +01:00
parent 50020bf1f0
commit 7f8b13434d
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
5 changed files with 51 additions and 11 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Create temp directories
[[ ! -d /tmp/sa-rules-schaal ]] && mkdir -p /tmp/sa-rules-schaal
#[[ ! -d /tmp/sa-rules-schaal ]] && mkdir -p /tmp/sa-rules-schaal
[[ ! -d /tmp/sa-rules-heinlein ]] && mkdir -p /tmp/sa-rules-heinlein
# Hash current SA rules
@ -19,12 +19,12 @@ if gzip -t /tmp/sa-rules-heinlein.tar.gz; then
cat /tmp/sa-rules-heinlein/*cf > /etc/rspamd/custom/sa-rules
fi
## Schaal
curl --connect-timeout 15 --max-time 30 http://sa.schaal-it.net/$(dig txt 1.4.3.sa.schaal-it.net +short | tr -d '"').tar.gz --output /tmp/sa-rules-schaal.tar.gz
if gzip -t /tmp/sa-rules-schaal.tar.gz; then
tar xfvz /tmp/sa-rules-schaal.tar.gz -C /tmp/sa-rules-schaal
# Append, do not overwrite
cat /tmp/sa-rules-schaal/*cf >> /etc/rspamd/custom/sa-rules
fi
#curl --connect-timeout 15 --max-time 30 http://sa.schaal-it.net/$(dig txt 1.4.3.sa.schaal-it.net +short | tr -d '"').tar.gz --output /tmp/sa-rules-schaal.tar.gz
#if gzip -t /tmp/sa-rules-schaal.tar.gz; then
# tar xfvz /tmp/sa-rules-schaal.tar.gz -C /tmp/sa-rules-schaal
# # Append, do not overwrite
# cat /tmp/sa-rules-schaal/*cf >> /etc/rspamd/custom/sa-rules
#fi
sed -i -e 's/\([^\\]\)\$\([^\/]\)/\1\\$\2/g' /etc/rspamd/custom/sa-rules

View File

@ -0,0 +1,24 @@
rules {
"LONG" {
train {
max_trains = 200;
max_usages = 20;
max_iterations = 25;
learning_rate = 0.01,
}
symbol_spam = "NEURAL_SPAM_LONG";
symbol_ham = "NEURAL_HAM_LONG";
ann_expire = 45d;
}
"SHORT" {
train {
max_trains = 100;
max_usages = 10;
max_iterations = 15;
learning_rate = 0.01,
}
symbol_spam = "NEURAL_SPAM_SHORT";
symbol_ham = "NEURAL_HAM_SHORT";
ann_expire = 7d;
}
}

View File

@ -0,0 +1,18 @@
symbols = {
"NEURAL_SPAM_LONG" {
weight = 3.7; # sample weight
description = "Neural network spam (long)";
}
"NEURAL_HAM_LONG" {
weight = -4.0; # sample weight
description = "Neural network ham (long)";
}
"NEURAL_SPAM_SHORT" {
weight = 2.5; # sample weight
description = "Neural network spam (short)";
}
"NEURAL_HAM_SHORT" {
weight = -2.0; # sample weight
description = "Neural network ham (short)";
}
}

View File

@ -7,5 +7,3 @@ dns {
retransmits = 2;
}
disable_monitoring = true;
lua_gc_step = 10;
lua_gc_pause = 10;

View File

@ -68,7 +68,7 @@ services:
- clamd
rspamd-mailcow:
image: mailcow/rspamd:1.54
image: mailcow/rspamd:1.55
build: ./data/Dockerfiles/rspamd
stop_grace_period: 30s
depends_on:
@ -174,7 +174,7 @@ services:
- sogo
dovecot-mailcow:
image: mailcow/dovecot:1.94
image: mailcow/dovecot:1.95
build: ./data/Dockerfiles/dovecot
dns:
- ${IPV4_NETWORK:-172.22.1}.254