Skip to content

Commit 91c3812

Browse files
committed
Changed dovecot quota file location to /var/vmail/domain.tld/user/.quotausage
1 parent bea2c2d commit 91c3812

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

install/tpl/debian6_dovecot.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protocol lda {
4848

4949
## Plugin settings
5050
plugin {
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

server/lib/classes/monitor_tools.inc.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)