Skip to content

Commit d496758

Browse files
committed
Fixed a bug when maildirs are created.
1 parent bc41bb0 commit d496758

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/plugins-available/mail_plugin.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ function user_insert($event_name,$data) {
6767

6868
// Create the maildir, if it does not exist
6969
if(!is_dir($data['new']['maildir'])) {
70-
exec('mkdir -p '.escapeshellcmd($data['new']['maildir']));
71-
exec('maildirmake '.escapeshellcmd($data['new']['maildir']));
72-
exec('chown '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir']));
70+
exec("su -c 'mkdir -p ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']);
71+
exec("su -c 'maildirmake ".escapeshellcmd($data['new']['maildir'])."' ".$mail_config['mailuser_name']);
72+
//exec('maildirmake '.escapeshellcmd($data['new']['maildir']));
73+
exec('chown -R '.$mail_config['mailuser_name'].':'.$mail_config['mailuser_group'].' '.escapeshellcmd($data['new']['maildir']));
7374
$app->log('Created Maildir: '.$data['new']['maildir'],LOGLEVEL_DEBUG);
7475
}
7576
}

0 commit comments

Comments
 (0)