fixed spam score filtering

This commit is contained in:
Andris Reinman 2018-12-29 12:56:06 +02:00
parent 05c79b680f
commit 56d82657c7
2 changed files with 8 additions and 8 deletions

View file

@ -128,8 +128,8 @@ module.exports = {
this._server.onAppend(path, flags, internaldate, raw, this.session, (err, success, info) => {
Object.keys(info || {}).forEach(key => {
let vkey = '_' + key.replace(/[A-Z]+/g, c => '_' + c.toLowerCase());
if (vkey === '_id') {
vkey = '_append_id';
if (['_id', '_status'].includes(vkey)) {
vkey = '_append' + vkey;
}
logdata[vkey] = info[key];
});

View file

@ -248,28 +248,28 @@ class FilterHandler {
isSpam = false;
filterActions.set('spam', false);
} else if (!filterActions.has('spam')) {
let spamLevel;
let spamScore;
switch (meta.spamAction) {
case 'reject':
spamLevel = 25;
spamScore = 75;
break;
case 'rewrite subject':
case 'soft reject':
spamLevel = 50;
spamScore = 50;
break;
case 'greylist':
case 'add header':
spamLevel = 75;
spamScore = 25;
break;
case 'no action':
default:
spamLevel = 100;
spamScore = 0;
break;
}
isSpam = userData.spamLevel >= spamLevel;
isSpam = spamScore >= userData.spamLevel;
}
if (isSpam && !filterActions.has('spam')) {