Skip to content

Commit

Permalink
make sure the amavis-user can always access the dkim-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Schaal committed Aug 3, 2014
1 parent d57ffdc commit 2b05c20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Remote_API_docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@


The remote API documentation is in the remote_client/API-docs subfolder.
The remote API documentation is in the remoting_client/API-docs subfolder.
10 changes: 9 additions & 1 deletion server/plugins-available/mail_plugin_dkim.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ function check_system($data) {

if (!is_dir($mail_config['dkim_path'])) {
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
mkdir($mail_config['dkim_path'], 0750, true);
$amavis_user=exec('grep -o "^amavis:\|^vscan:" /etc/passwd');
if(!empty($amavis_user)) {
$amavis_user=rtrim($amavis_user, ":");
mkdir($mail_config['dkim_path'], 0750, true);
exec('chown '.$amavis_user.' /var/lib/amavis/dkim');
unset $amavis_user;
} else {
mkdir($mail_config['dkim_path'], 0755, true);
}
}

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

0 comments on commit 2b05c20

Please sign in to comment.