Skip to content

Commit

Permalink
adjust rspamd user to froxlor
Browse files Browse the repository at this point in the history
  • Loading branch information
z-e-r-0-t committed Nov 17, 2024
1 parent 02ec06f commit 3cd4b33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Froxlor/Cron/Mail/Rspamd.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public function writeDkimConfigs()
}
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
FileDir::safe_exec("chown _rspamd:_rspamd " . escapeshellarg($privkey_filename));
FileDir::safe_exec("chown rspamd:rspamd " . escapeshellarg($privkey_filename));
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
FileDir::safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
FileDir::safe_exec("chown _rspamd:_rspamd " . escapeshellarg($pubkey_filename));
FileDir::safe_exec("chown rspamd:rspamd " . escapeshellarg($pubkey_filename));
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
`dkim_id` = :dkimid,
Expand All @@ -144,13 +144,13 @@ public function writeDkimConfigs()
if (!file_exists($privkey_filename) && $domain['dkim_privkey'] != '') {
file_put_contents($privkey_filename, $domain['dkim_privkey']);
FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
FileDir::safe_exec("chown _rspamd:_rspamd " . escapeshellarg($privkey_filename));
FileDir::safe_exec("chown rspamd:rspamd " . escapeshellarg($privkey_filename));
}

if (!file_exists($pubkey_filename) && $domain['dkim_pubkey'] != '') {
file_put_contents($pubkey_filename, $domain['dkim_pubkey']);
FileDir::safe_exec("chmod 0644 " . escapeshellarg($pubkey_filename));
FileDir::safe_exec("chown _rspamd:_rspamd " . escapeshellarg($pubkey_filename));
FileDir::safe_exec("chown rspamd:rspamd " . escapeshellarg($pubkey_filename));
}

$dkim_selector_map .= $domain['domain'] . " dkim" . $domain['dkim_id'] . "\n";
Expand Down

0 comments on commit 3cd4b33

Please sign in to comment.