Commit 1eb51aa6 authored by Marius Burkard's avatar Marius Burkard

- fixed white/blacklisting for rspamd

parent 78041c8d
......@@ -103,7 +103,7 @@ function checkDbHealth() {
$notok = array();
echo "Checking ISPConfig database .. ";
exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." -r ".escapeshellarg($conf["mysql"]["database"]), $result);
exec("mysqlcheck -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." --auto-repair ".escapeshellarg($conf["mysql"]["database"]), $result);
for( $i=0; $i<sizeof($result);$i++) {
if ( substr($result[$i], -2) != "OK" ) {
$notok[] = $result[$i];
......
......@@ -5,34 +5,34 @@ spamfilter_users-<tmpl_var name='record_id'> {
want_spam = yes;
</tmpl_if>
<tmpl_if name='spam_lover_virus_lover' op='==' value='spam_lover_AND_NOTvirus_lover'>
apply "default" {
apply {
CLAM_VIRUS = 1999.0;
JUST_EICAR = 1999.0;
actions {
reject = 999.0;
reject = null;
}
}
</tmpl_if>
<tmpl_if name='spam_lover_virus_lover' op='==' value='NOTspam_lover_AND_virus_lover'>
apply "default" {
apply {
CLAM_VIRUS = -999.0;
JUST_EICAR = -999.0;
actions {
<tmpl_if name='rspamd_greylisting' op='==' value='y'>greylist = <tmpl_var name='rspamd_spam_greylisting_level'>;</tmpl_if>
<tmpl_var name='rspamd_spam_tag_method'> = <tmpl_var name='rspamd_spam_tag_level'>;
<tmpl_if name='rspamd_spam_tag_method' op='==' value='rewrite_subject'>"rewrite subject" = <tmpl_var name='rspamd_spam_tag_level'>;</tmpl_if>
<tmpl_if name='rspamd_spam_tag_method' op='==' value='add_header'>"add header" = <tmpl_var name='rspamd_spam_tag_level'>;</tmpl_if>
reject = <tmpl_var name='rspamd_spam_kill_level'>;
}
}
</tmpl_if>
<tmpl_if name='spam_lover_virus_lover' op='==' value='NOTspam_lover_AND_NOTvirus_lover'>
apply "default" {
apply {
CLAM_VIRUS = <tmpl_var name='rspamd_virus_kill_level'>;
JUST_EICAR = <tmpl_var name='rspamd_virus_kill_level'>;
actions {
<tmpl_if name='rspamd_greylisting' op='==' value='y'>greylist = <tmpl_var name='rspamd_spam_greylisting_level'>;</tmpl_if>
<tmpl_var name='rspamd_spam_tag_method'> = <tmpl_var name='rspamd_spam_tag_level'>;
<tmpl_if name='rspamd_spam_tag_method' op='==' value='rewrite_subject'>"rewrite subject" = <tmpl_var name='rspamd_spam_tag_level'>;</tmpl_if>
<tmpl_if name='rspamd_spam_tag_method' op='==' value='add_header'>"add header" = <tmpl_var name='rspamd_spam_tag_level'>;</tmpl_if>
reject = <tmpl_var name='rspamd_spam_kill_level'>;
}
}
......
......@@ -4,14 +4,22 @@ spamfilter_wblist-<tmpl_var name='record_id'> {
rcpt = "<tmpl_var name='recipient'>";
<tmpl_if name='wblist' op='==' value='W'>
want_spam = yes;
apply {
actions {
reject = null;
"add header" = null;
greylist = null;
"rewrite subject" = null;
}
}
</tmpl_else>
apply "default" {
apply {
R_DUMMY = 999.0;
actions {
reject = 0.2;
add_header = 0.1;
"add header" = 0.1;
greylist = 0.1;
rewrite_subject = 0.1;
"rewrite subject" = 0.1;
}
}
</tmpl_if>
......
......@@ -189,7 +189,8 @@ class rspamd_plugin {
$tpl = new tpl();
$tpl->newTemplate('rspamd_wblist.inc.conf.master');
$tpl->setVar('record_id', intval($data['new']['wblist_id']));
$tpl->setVar('priority', intval($data['new']['priority']));
// we need to add 10 to priority to avoid mailbox/domain spamfilter settings overriding white/blacklists
$tpl->setVar('priority', intval($data['new']['priority']) + 10);
$tpl->setVar('from', $app->functions->idn_encode($data['new']['email']));
$tpl->setVar('recipient', $app->functions->idn_encode($recipient['email']));
//$tpl->setVar('action', ($data['new']['wb'] == 'W'? 'want_spam = yes;' : 'action = "reject";'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment