File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ protocol lda {
4848
4949## Plugin settings
5050plugin {
51- quota = dict:user::file:/var/vmail/%n_%d_quota
51+ quota = dict:user::file:/var/vmail/%d/%n/.quotausage
5252 # Because the mail quota is called in the user query
5353 # the maildir quota does not need to be set.
5454 # You do not need: quota = maildir
Original file line number Diff line number Diff line change @@ -164,8 +164,25 @@ public function monitorEmailQuota() {
164164
165165 //* The state of the email_quota.
166166 $ state = 'ok ' ;
167+
168+ $ mailboxes = $ app ->db ->queryAllRecords ("SELECT email FROM mail_user WHERE server_id = $ server_id " );
169+ if (is_array ($ mailboxes )) {
170+ foreach ($ mailboxes as $ mb ) {
171+ $ email = $ mb ['email ' ];
172+ $ email_parts = explode ('@ ' ,$ mb ['email ' ]);
173+ $ filename = '/var/vmail/ ' .$ email_parts [1 ].'/ ' .$ email_parts [0 ].'/.quotausage ' ;
174+ if (file_exists ($ filename )) {
175+ $ quotafile = file ($ filename );
176+ $ data [$ email ]['used ' ] = trim ($ quotafile ['1 ' ]);
177+ unset($ quotafile );
178+ }
179+ }
180+ }
181+
182+ unset($ mailboxes );
167183
168184 //* Dovecot quota check Courier in progress lathama@gmail.com
185+ /*
169186 if($dir = opendir("/var/vmail")){
170187 while (($quotafiles = readdir($dir)) !== false){
171188 if(preg_match('/.\_quota$/', $quotafiles)){
@@ -177,6 +194,7 @@ public function monitorEmailQuota() {
177194 }
178195 closedir($dir);
179196 }
197+ */
180198 $ res ['server_id ' ] = $ server_id ;
181199 $ res ['type ' ] = $ type ;
182200 $ res ['data ' ] = $ data ;
You can’t perform that action at this time.
0 commit comments