@@ -139,12 +139,14 @@ function user_insert($event_name,$data) {
139139 $ app ->log ("Set ownership on " .escapeshellcmd ($ data ['new ' ]['maildir ' ]),LOGLEVEL_DEBUG );
140140
141141 //* This is to fix the maildrop quota not being rebuilt after the quota is changed.
142- exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ]); // Avoid maildirmake quota bug, see debian bug #214911
143- $ app ->log ('Created Maildir: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
142+ if ($ mail_config ['pop3_imap_daemon ' ] != 'dovecot ' ) {
143+ exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ]); // Avoid maildirmake quota bug, see debian bug #214911
144+ $ app ->log ('Created Maildir: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
145+ }
144146 }
145147
146148 //* Set the maildir quota
147- if (is_dir ($ data ['new ' ]['maildir ' ].'/new ' )) {
149+ if (is_dir ($ data ['new ' ]['maildir ' ].'/new ' ) && $ mail_config [ ' pop3_imap_daemon ' ] != ' dovecot ' ) {
148150 exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."' " .$ mail_config ['mailuser_name ' ]);
149151 $ app ->log ('Set Maildir quota: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
150152 }
@@ -219,8 +221,10 @@ function user_update($event_name,$data) {
219221 exec ('chown -R ' .$ mail_config ['mailuser_name ' ].': ' .$ mail_config ['mailuser_group ' ].' ' .escapeshellcmd ($ data ['new ' ]['maildir ' ]));
220222 $ app ->log ("Set ownership on " .escapeshellcmd ($ data ['new ' ]['maildir ' ]),LOGLEVEL_DEBUG );
221223 //* This is to fix the maildrop quota not being rebuilt after the quota is changed.
222- exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ]); // Avoid maildirmake quota bug, see debian bug #214911
223- $ app ->log ('Updated Maildir quota: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
224+ if ($ mail_config ['pop3_imap_daemon ' ] != 'dovecot ' ) {
225+ exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ]); // Avoid maildirmake quota bug, see debian bug #214911
226+ $ app ->log ('Updated Maildir quota: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ maildomain_path )."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
227+ }
224228 }
225229
226230 // Move mailbox, if domain has changed and delete old mailbox
@@ -237,15 +241,10 @@ function user_update($event_name,$data) {
237241 }
238242 //This is to fix the maildrop quota not being rebuilt after the quota is changed.
239243 // Courier Layout
240- if (is_dir ($ data ['new ' ]['maildir ' ].'/new ' )) {
244+ if (is_dir ($ data ['new ' ]['maildir ' ].'/new ' ) && $ mail_config [ ' pop3_imap_daemon ' ] != ' dovecot ' ) {
241245 exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."' " .$ mail_config ['mailuser_name ' ]);
242246 $ app ->log ('Updated Maildir quota: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
243247 }
244- // Dovecot Layout
245- if (is_dir ($ data ['new ' ]['maildir ' ].'/Maildir/new ' )) {
246- exec ("su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."/Maildir' " .$ mail_config ['mailuser_name ' ]);
247- $ app ->log ('Updated Maildir quota: ' ."su -c 'maildirmake -q " .$ data ['new ' ]['quota ' ]."S " .escapeshellcmd ($ data ['new ' ]['maildir ' ])."/Maildir' " .$ mail_config ['mailuser_name ' ],LOGLEVEL_DEBUG );
248- }
249248 }
250249
251250 function user_delete ($ event_name ,$ data ) {
0 commit comments