@@ -295,7 +295,11 @@ function user_settings_update($event_name, $data, $internal = false) {
295295 $ app ->load ('tpl ' );
296296
297297 $ tpl = new tpl ();
298- $ tpl ->newTemplate ('rspamd_users.inc.conf.master ' );
298+ if (file_exists ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_users.inc.conf.master " )) {
299+ $ tpl ->newTemplate ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_users.inc.conf.master " );
300+ } else {
301+ $ tpl ->newTemplate ("rspamd_users.inc.conf.master " );
302+ }
299303
300304 $ tpl ->setVar ('record_identifier ' , 'ispc_ ' . $ type . '_ ' . $ entry_id );
301305 $ tpl ->setVar ('priority ' , $ settings_priority );
@@ -443,7 +447,12 @@ function spamfilter_wblist_update($event_name, $data) {
443447 }
444448 } else {
445449 $ tpl = new tpl ();
446- $ tpl ->newTemplate ('rspamd_wblist.inc.conf.master ' );
450+ if (file_exists ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_wblist.inc.conf.master " )) {
451+ $ tpl ->newTemplate ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_wblist.inc.conf.master " );
452+ } else {
453+ $ tpl ->newTemplate ("rspamd_wblist.inc.conf.master " );
454+ }
455+
447456 $ tpl ->setVar ('list_scope ' , ($ global_filter ? 'global ' : 'spamfilter ' ));
448457 $ tpl ->setVar ('record_id ' , $ record_id );
449458 // add 30/40 to priority to avoid collisions and prefer white/blacklists above mailbox/domain spamfilter settings
@@ -521,7 +530,11 @@ function server_update($event_name, $data) {
521530 );
522531 foreach ($ local_d as $ f ) {
523532 $ tpl = new tpl ();
524- $ tpl ->newTemplate ("rspamd_ $ {f}.master " );
533+ if (file_exists ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_ $ {f}.master " )) {
534+ $ tpl ->newTemplate ($ conf ['rootpath ' ]."/conf-custom/install/rspamd_ $ {f}.master " );
535+ } else {
536+ $ tpl ->newTemplate ("rspamd_ $ {f}.master " );
537+ }
525538
526539 $ tpl ->setVar ('dkim_path ' , $ mail_config ['dkim_path ' ]);
527540 $ tpl ->setVar ('rspamd_redis_servers ' , $ mail_config ['rspamd_redis_servers ' ]);
0 commit comments