mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 17:44:49 +02:00
Rspamd: add check for DKIM private key files' permissions (#3627)
* added check for Rspamd DKIM on startup The newly added function `__rspamd__check_dkim_permissions` performs a check on DKIM private key files. This is useful to prevent issues like #3621 in the future. The function is deliberately kept simple and may not catch every single misconfiguration in terms of permissions and ownership, but it should be quite accurate. Please note that the Rspamd setup does NOT change at all, and the checks will not abort the setup in case they fail. A simple warning is emmited. * add more documentation to Rspamd functions * Apply suggestions from code review * improve `__do_as_rspamd_user` * rework check similar to review suggestion see https://github.com/docker-mailserver/docker-mailserver/pull/3627#discussion_r1388697547 --------- Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
parent
26214491ef
commit
5f2fb72c9c
3 changed files with 53 additions and 7 deletions
|
@ -62,13 +62,6 @@ ${ORANGE}EXIT STATUS${RESET}
|
|||
"
|
||||
}
|
||||
|
||||
function __do_as_rspamd_user() {
|
||||
local COMMAND=${1:?Command required when using __do_as_rspamd_user}
|
||||
_log 'trace' "Running '${*}' as user '_rspamd' now"
|
||||
shift 1
|
||||
su -l '_rspamd' -s "$(command -v "${COMMAND}")" -- "${@}"
|
||||
}
|
||||
|
||||
function _parse_arguments() {
|
||||
FORCE=0
|
||||
KEYTYPE='rsa'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue