Skip to content

Commit f5b9582

Browse files
author
Marius Burkard
committed
- use crypted password for rspamd UI if possible
1 parent 7f9a53e commit f5b9582

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/plugins-available/postfix_server_plugin.inc.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,15 @@ function update($event_name, $data) {
217217
if($mail_config['content_filter'] == 'rspamd' && ($mail_config['rspamd_password'] != $old_ini_data['mail']['rspamd_password'] || $mail_config['content_filter'] != $old_ini_data['mail']['content_filter'])) {
218218
$app->load('tpl');
219219

220+
$rspamd_password = $mail_config['rspamd_password'];
221+
$crypted_password = trim(exec('rspamadm pw -p ' . escapeshellarg($rspamd_password)));
222+
if($crypted_password) {
223+
$rspamd_password = $crypted_password;
224+
}
225+
220226
$tpl = new tpl();
221227
$tpl->newTemplate('rspamd_worker-controller.inc.master');
222-
$tpl->setVar('rspamd_password', $mail_config['rspamd_password']);
228+
$tpl->setVar('rspamd_password', $rspamd_password);
223229
$app->system->file_put_contents('/etc/rspamd/local.d/worker-controller.inc', $tpl->grab());
224230
$app->services->restartServiceDelayed('rspamd', 'reload');
225231
}

0 commit comments

Comments
 (0)