Add few features to rspamd

This commit is contained in:
Alex D. 2021-02-11 10:19:23 +00:00
parent f5e6ddb18d
commit b720cac61b
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
5 changed files with 43 additions and 17 deletions

View File

@ -5,8 +5,8 @@ _configpath="/etc/rspamd/redxen"
. ../APKBUILD-config.common
pkgver=2021.02.05
pkgrel=2
pkgver=2021.02.11
pkgrel=0
_baseconf="
rspamd.conf
composites.conf
@ -23,7 +23,9 @@ _modules="
greylist
maillist
milter_headers
mx_check
phishing
ratelimit
rbl
redis
spf
@ -48,16 +50,18 @@ _module() {
sha512sums="99985993e5d7c525280020e7dc30106b3efbaa8ae2830a5069ad4270a8336d33efca74ed26103e1d2f5f341a0cffc4e0f77a2757fdeab27e3b492aa99ae7f977 spf.conf
d42a74d17771497960477878eedda2a00a434cbc1e994b015c21b4f631e24836cb6a7b14a24a2cb42ed15425b7758dc307a6cf602a770cfb0cc20b6f90064af9 redis.conf
a3849ae55a68c90afd913ed18f6b210803f5dbaa2beab5abf23a84b9b4bcb48e617023123724222c1f74a005bf03e1c94e3fa1ded5a6f252d9c2ac317dabc1a2 rbl.conf
a753d136a21206cdc28a1554a38f51ad55e2eec842a31dbe1d151198bb8d9bb090e0f49b6b50cbc44e5011efb2ebeb2d2657a54df2f1a0c89ce3134fbd55220c ratelimit.conf
6ca83b91e70e43eff6de380065fc5591c6669a27497a47d74e5e096df68afea6269cfad41be982bb144f2dfb92fd5765a600cf9c4067c4612bd1aa1bf5e6ebfd phishing.conf
47907ec7d9d9d2775d7feeef448d53940e3e21b0e5cc17e40663e2cbac42e4e8a29eb53a956ffbca3f425c3b4673192354b3be2e575a0b8e8014efdd5b957e6d mx_check.conf
932c0dc5ae47ecc470c0a5eb684c5d24f95a75dec09e4ee3e191b0cfa274a4a9e343ed012afeb83d405df802792f9c5a3ad11c73bb933d40210c9e149314c12b milter_headers.conf
08966d0a3c077a12a1113f774e11d51d3c7d04bb45914e295324e8aa51c3d75b55395c256a905c6d9ae1e98a004a9e6b3b37d36fce810a426dd5d90408331c0a maillist.conf
8660fd01589476bbc01bbe75bed392faa55f55fa9b6fea77be79f339cefb43ddbacdbe193ad136c42da91d4ef7f1e1ec40fc5f8f4f398d04bcebf51d5a59ad1f greylist.conf
e14c3683b48dde5584cbcd0bd5811f6111a201635dd7400d7703003b4c98255d10be9b64ee81784c1fe1df50159e12d6777086c5a18ee9b14be852d233cf6dc5 dmarc.conf
ad3fa5e3c4c3d7b882c9e85bdde3b1949a32f2f2c9dd43e38977d828e7b6740d31002c502f24a0ea2e27105d5a6b1af7b7140c5d8e306f90c3f7d28c1e4607d5 dkim.conf
dcec5c53bd29c345ed5c47727af9a8d11328cc8f69ae61064ba3b053ee306baa79b747067097b2354a1fecd6e6527d56d14c79be22c94531f2a5ddc41ce3ca7e chartable.conf
b8c31e4679846f724e183d40cfab43b1174c3370991ead1a7198a39ec80fc85dff9fb3c823f793d3535f6eb2ae6373db380c5b84370eae1e7e15142fb968d8c6 rspamd.conf
855c34d265d91555c7946eb388d8f67f15b2bb450567aa67cf23ddcc2aaf52643cbeae674c66fcde0b0dd037fb4b56e1f4a2b9c0596b96fbe1cb29c03136961b rspamd.conf
667ec0331c811730e096e27f5e8659062239f46e3ccd148411984bb4d83b8770cc0d7d3c74dd5a2da71781e9b99d4bcb5a700cbd5f56ae8e17f7c4e50519ffb2 composites.conf
4ea651877607573126a731619801458798c1e8e4de3522462af4c71adc38141d09a0c75c2c83a33698e3c51095d0b7d364e1ceb3aa534a4157106370a7800e4a groups.conf
78df39cbc6e09cdc5e01d27e123d82aa677a70a6f5d59ba0be8d0ce6af012c5311e4a2527e4fbc586f9cdd8da033e9f05e2371970fa23db60eaa8c16c8e85f05 logging.conf
2d27d5ac1800ee28948f8fcc276cc5c62c97a19d01dde2263eadf3ec4f8eb3bbb8417f4271324c5cfbf1ebd60759aa9047849ea803da96c8632c21966b794e6c statistic.conf
8ee629e299606e9effa4a55bd029a67d0682a6d5f86a652f5f98fabc915770ed6f3c32738dd38b88ccef2058084026f1ab9fcb48ff2709e6624e70a8bb7bfd15 statistic.conf
61a0da877f34aadb83ceece960e07aabf2312d7105c7574bec6f8bc9e7989bf28806159330e9d47850afa679a9d48b9101fd6b3ba04f0a614b0c66d95ccd6605 workers.conf"

View File

@ -0,0 +1,11 @@
mx_check {
enabled = true;
timeout = 1.0;
symbol_bad_mx = "MX_INVALID";
symbol_no_mx = "MX_MISSING";
symbol_good_mx = "MX_GOOD";
expire = 86400;
expire_novalid = 7200;
greylist_invalid = true;
key_prefix = "rmx";
}

View File

@ -0,0 +1,12 @@
ratelimit {
rates {
to = "100 / 1s";
to_ip = "100 / 1s";
to_ip_from = "100 / 1s";
bounce_to = "100 / 1h";
bounce_to_ip = "7 / 1m";
}
whitelisted_rcpts = "postmaster,mailer-daemon";
max_rcpt = 25;
info_symbol = "RATELIMITED";
}

View File

@ -1,6 +1,6 @@
options {
pidfile = "$RUNDIR/rspamd.pid";
filters = "chartable,dkim,dmarc,greylist,maillist,milter_headers,phishing,rbl,redis,spf";
filters = "chartable,dkim,dmarc,greylist,maillist,milter_headers,phishing,rbl,redis,spf,ratelimit,bayes_expiry,mx_check";
raw_mode = false;
one_shot = false;
cache_file = "$DBDIR/symbols.cache";

View File

@ -1,14 +1,15 @@
classifier "bayes" {
learn_condition = 'return require("lua_bayes_learn").can_learn';
tokenizer {
name = "osb";
}
cache {}
new_schema = true;
store_tokens = false;
signatures = false;
min_tokens = 11;
backend = "redis";
min_learns = 200;
min_tokens = 11;
min_learns = 5;
new_schema = true;
store_tokens = true;
signatures = false;
expire = 2592000;
statfile {
symbol = "BAYES_HAM";
spam = false;
@ -17,12 +18,10 @@ classifier "bayes" {
symbol = "BAYES_SPAM";
spam = true;
}
learn_condition = 'return require("lua_bayes_learn").can_learn';
autolearn {
spam_threshold = 6.0; # When to learn spam (score >= threshold)
ham_threshold = -0.5; # When to learn ham (score <= threshold)
check_balance = true; # Check spam and ham balance
min_balance = 0.9; # Keep diff for spam/ham learns for at least this value
spam_threshold = 10.0;
ham_threshold = -2.5;
check_balance = true;
min_balance = 0.9;
}
}