Skip to content

Commit a14360e

Browse files
author
Marius Burkard
committed
- rspamd config fixes
1 parent 5af7908 commit a14360e

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
group "antivirus" {
2+
.include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/antivirus_group.conf"
3+
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/antivirus_group.conf"
4+
}

server/plugins-available/postfix_server_plugin.inc.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,18 @@ function update($event_name, $data) {
208208
$app->system->mkdirpath('/etc/rspamd/local.d/');
209209
}
210210

211+
if(!is_dir('/etc/rspamd/override.d/')){
212+
$app->system->mkdirpath('/etc/rspamd/override.d/');
213+
}
214+
211215
$this->server_ip($event_name, $data);
212216

217+
if(file_exists($conf['rootpath'].'/conf-custom/rspamd_groups.conf.master')) {
218+
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_groups.conf.master /etc/rspamd/local.d/groups.conf');
219+
} else {
220+
exec('cp '.$conf['rootpath'].'/conf/rspamd_groups.conf.master /etc/rspamd/local.d/groups.conf');
221+
}
222+
213223
if(file_exists($conf['rootpath'].'/conf-custom/rspamd_antivirus.conf.master')) {
214224
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_antivirus.conf.master /etc/rspamd/local.d/antivirus.conf');
215225
} else {
@@ -235,15 +245,15 @@ function update($event_name, $data) {
235245
}
236246

237247
if(file_exists($conf['rootpath'].'/conf-custom/rspamd_override_rbl.conf.master')) {
238-
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_override_rbl.conf.master /etc/rspamd/override.d/group_rbl.conf');
248+
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_override_rbl.conf.master /etc/rspamd/override.d/rbl_group.conf');
239249
} else {
240-
exec('cp '.$conf['rootpath'].'/conf/rspamd_override_rbl.conf.master /etc/rspamd/override.d/group_rbl.conf');
250+
exec('cp '.$conf['rootpath'].'/conf/rspamd_override_rbl.conf.master /etc/rspamd/override.d/rbl_group.conf');
241251
}
242252

243253
if(file_exists($conf['rootpath'].'/conf-custom/rspamd_override_surbl.conf.master')) {
244-
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_override_surbl.conf.master /etc/rspamd/override.d/group_surbl.conf');
254+
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd_override_surbl.conf.master /etc/rspamd/override.d/surbl_group.conf');
245255
} else {
246-
exec('cp '.$conf['rootpath'].'/conf/rspamd_override_surbl.conf.master /etc/rspamd/override.d/group_surbl.conf');
256+
exec('cp '.$conf['rootpath'].'/conf/rspamd_override_surbl.conf.master /etc/rspamd/override.d/surbl_group.conf');
247257
}
248258

249259
if(file_exists($conf['rootpath'].'/conf-custom/rspamd_mx_check.conf.master')) {
@@ -252,11 +262,13 @@ function update($event_name, $data) {
252262
exec('cp '.$conf['rootpath'].'/conf/rspamd_mx_check.conf.master /etc/rspamd/local.d/mx_check.conf');
253263
}
254264

255-
if(file_exists($conf['rootpath'].'/conf-custom/rspamd.local.lua.master')) {
265+
/*if(file_exists($conf['rootpath'].'/conf-custom/rspamd.local.lua.master')) {
256266
exec('cp '.$conf['rootpath'].'/conf-custom/rspamd.local.lua.master /etc/rspamd/rspamd.local.lua');
257267
} else {
258268
exec('cp '.$conf['rootpath'].'/conf/rspamd.local.lua.master /etc/rspamd/rspamd.local.lua');
259-
}
269+
}*/
270+
271+
exec('chmod a+r /etc/rspamd/local.d/* /etc/rspamd/override.d/*');
260272

261273
$tpl = new tpl();
262274
$tpl->newTemplate('rspamd_dkim_signing.conf.master');
@@ -289,7 +301,7 @@ function update($event_name, $data) {
289301
$tpl->newTemplate('rspamd_worker-controller.inc.master');
290302
$tpl->setVar('rspamd_password', $mail_config['rspamd_password']);
291303
$app->system->file_put_contents('/etc/rspamd/local.d/worker-controller.inc', $tpl->grab());
292-
if(is_file('/etc/init.d/rspamd')) $app->services->restartServiceDelayed('rspamd', 'reload');
304+
$app->services->restartServiceDelayed('rspamd', 'reload');
293305
}
294306

295307
exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); //TODO : no reload?

0 commit comments

Comments
 (0)