Skip to content

Commit 512f11d

Browse files
committed
- Fixed: FS#2292 - monitor_tools.inc.php uses /var/vmail and not the mail directory specified in server config
- Changed code comment in login/index.php file.
1 parent 1a94982 commit 512f11d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

interface/web/login/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function render() {
111111
//* Check if there are already wrong logins
112112
$sql = "SELECT * FROM `attempts_login` WHERE `ip`= '{$ip}' AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1";
113113
$alreadyfailed = $app->db->queryOneRecord($sql);
114-
//* login to much wrong
114+
//* too many failedlogins
115115
if($alreadyfailed['times'] > 5) {
116116
$error = $app->lng('error_user_too_many_logins');
117117
} else {

server/lib/classes/monitor_tools.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,18 @@ public function monitorEmailQuota() {
238238
//* The state of the email_quota.
239239
$state = 'ok';
240240

241-
$mailboxes = $app->db->queryAllRecords("SELECT email FROM mail_user WHERE server_id = $server_id");
241+
$mailboxes = $app->db->queryAllRecords("SELECT email,maildir FROM mail_user WHERE server_id = $server_id");
242242
if(is_array($mailboxes)) {
243243
foreach($mailboxes as $mb) {
244244
$email = $mb['email'];
245245
$email_parts = explode('@',$mb['email']);
246-
$filename = '/var/vmail/'.$email_parts[1].'/'.$email_parts[0].'/.quotausage';
247-
if(file_exists($filename)) {
246+
$filename = $mb['maildir'].'/.quotausage';
247+
if(file_exists($filename) && !is_link($filename)) {
248248
$quotafile = file($filename);
249249
$data[$email]['used'] = trim($quotafile['1']);
250250
unset($quotafile);
251251
} else {
252-
exec('du -s '.escapeshellcmd('/var/vmail/'.$email_parts[1].'/'.$email_parts[0]),$out);
252+
exec('du -s '.escapeshellcmd($mb['maildir']),$out);
253253
$parts = explode(' ',$out[0]);
254254
$data[$email]['used'] = intval($parts[0])*1024;
255255
unset($out);

0 commit comments

Comments
 (0)