Skip to content

Commit 2b05c20

Browse files
author
Florian Schaal
committed
make sure the amavis-user can always access the dkim-dir
1 parent d57ffdc commit 2b05c20

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/Remote_API_docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
The remote API documentation is in the remote_client/API-docs subfolder.
3+
The remote API documentation is in the remoting_client/API-docs subfolder.

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ function check_system($data) {
123123

124124
if (!is_dir($mail_config['dkim_path'])) {
125125
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
126-
mkdir($mail_config['dkim_path'], 0750, true);
126+
$amavis_user=exec('grep -o "^amavis:\|^vscan:" /etc/passwd');
127+
if(!empty($amavis_user)) {
128+
$amavis_user=rtrim($amavis_user, ":");
129+
mkdir($mail_config['dkim_path'], 0750, true);
130+
exec('chown '.$amavis_user.' /var/lib/amavis/dkim');
131+
unset $amavis_user;
132+
} else {
133+
mkdir($mail_config['dkim_path'], 0755, true);
134+
}
127135
}
128136

129137
if (!is_writeable($mail_config['dkim_path'])) {

0 commit comments

Comments
 (0)