@@ -93,7 +93,7 @@ function user_insert($event_name, $data) {
9393 $ base_path = implode ('/ ' , $ tmp_basepath_parts );
9494
9595 //* Set the email-uid and gid if not given
96- if (($ data ['new ' ]['uid ' ] == 999989999 ) || ($ data ['new ' ]['gid ' ] == 999989999 )) {
96+ if (($ data ['new ' ]['uid ' ] == - 1 ) || ($ data ['new ' ]['gid ' ] == - 1 )) {
9797 $ app ->log ('Setting uid and gid automatically ' ,LOGLEVEL_DEBUG );
9898 if ($ mail_config ["mailbox_virtual_uidgid_maps " ] == 'y ' ) {
9999 $ app ->log ('Map uid to linux-user ' ,LOGLEVEL_DEBUG );
@@ -113,8 +113,8 @@ function user_insert($event_name, $data) {
113113 }
114114 }
115115 // if nothing set before -> use standard mailuser uid and gid vmail
116- if ($ data ['new ' ]['uid ' ] == 999989999 ) $ data ['new ' ]['uid ' ] = $ mail_config ["mailuser_uid " ];
117- if ($ data ['new ' ]['gid ' ] == 999989999 ) $ data ['new ' ]['gid ' ] = $ mail_config ["mailuser_gid " ];
116+ if ($ data ['new ' ]['uid ' ] == - 1 ) $ data ['new ' ]['uid ' ] = $ mail_config ["mailuser_uid " ];
117+ if ($ data ['new ' ]['gid ' ] == - 1 ) $ data ['new ' ]['gid ' ] = $ mail_config ["mailuser_gid " ];
118118 $ app ->log ('Mailuser uid: ' .$ data ['new ' ]['uid ' ].', gid: ' .$ data ['new ' ]['gid ' ],LOGLEVEL_DEBUG );
119119
120120 // update DB if values changed
@@ -148,7 +148,7 @@ function user_insert($event_name, $data) {
148148 if (!empty ($ maildomain_path ) && !is_dir ($ maildomain_path )) {
149149
150150 //exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
151- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group );
151+ $ app ->system ->maildirmake ($ maildomain_path , $ user , '' , $ group );
152152
153153 //* This is to fix the maildrop quota not being rebuilt after the quota is changed.
154154 if ($ mail_config ['pop3_imap_daemon ' ] != 'dovecot ' ) {
@@ -160,22 +160,22 @@ function user_insert($event_name, $data) {
160160 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Sent ' )) {
161161 //exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
162162 //$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
163- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Sent ' );
163+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Sent ' , $ group );
164164 }
165165 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Drafts ' )) {
166166 //exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
167167 //$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
168- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Drafts ' );
168+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Drafts ' , $ group );
169169 }
170170 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Trash ' )) {
171171 //exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
172172 //$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
173- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Trash ' );
173+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Trash ' , $ group );
174174 }
175175 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Junk ' )) {
176176 //exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
177177 //$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
178- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Junk ' );
178+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Junk ' , $ group );
179179 }
180180
181181 // Set permissions now recursive
@@ -284,7 +284,7 @@ function user_update($event_name, $data) {
284284 if (!empty ($ maildomain_path ) && !is_dir ($ maildomain_path .'/new ' )) {
285285 //exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
286286 //$app->log("Created Maildir "."su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
287- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group );
287+ $ app ->system ->maildirmake ($ maildomain_path , $ user , '' , $ group );
288288
289289 //* This is to fix the maildrop quota not being rebuilt after the quota is changed.
290290 if ($ mail_config ['pop3_imap_daemon ' ] != 'dovecot ' ) {
@@ -301,22 +301,22 @@ function user_update($event_name, $data) {
301301 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Sent ' )) {
302302 //exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
303303 //$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
304- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Sent ' );
304+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Sent ' , $ group );
305305 }
306306 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Drafts ' )) {
307307 //exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
308308 //$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
309- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Drafts ' );
309+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Drafts ' , $ group );
310310 }
311311 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Trash ' )) {
312312 //exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
313313 //$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
314- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Trash ' );
314+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Trash ' , $ group );
315315 }
316316 if (!is_dir ($ data ['new ' ]['maildir ' ].'/.Junk ' )) {
317317 //exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
318318 //$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
319- $ app ->system ->maildirmake ($ maildomain_path , $ user , $ group , 'Junk ' );
319+ $ app ->system ->maildirmake ($ maildomain_path , $ user , 'Junk ' , $ group );
320320 }
321321
322322 // Set permissions now recursive
0 commit comments