Commit 1b4ba060 authored by tbrehm's avatar tbrehm

Fixed: FS#418 - Mail traffice stats not being generated.

parent f12a6c40
......@@ -48,13 +48,13 @@ $app->uses('ini_parser,file,services');
$sql = "SELECT mailuser_id,maildir FROM mail_user WHERE server_id = ".$conf["server_id"];
$records = $app->db->queryAllRecords($sql);
foreach($records as $rec) {
if(@is_file($rec["maildir"].'.ispconfig_mailsize')) {
if(@is_file($rec["maildir"].'/.ispconfig_mailsize')) {
// rename file
rename($rec["maildir"].'.ispconfig_mailsize',$rec["maildir"].'.ispconfig_mailsize_save');
rename($rec["maildir"].'/.ispconfig_mailsize',$rec["maildir"].'/.ispconfig_mailsize_save');
// Read the file
$lines = file($rec["maildir"].'.ispconfig_mailsize_save');
$lines = file($rec["maildir"].'/.ispconfig_mailsize_save');
$mail_traffic = 0;
foreach($lines as $line) {
$mail_traffic += intval($line);
......@@ -62,7 +62,7 @@ foreach($records as $rec) {
unset($lines);
// Delete backup file
if(@is_file($rec["maildir"].'.ispconfig_mailsize_save')) unlink($rec["maildir"].'.ispconfig_mailsize_save');
if(@is_file($rec["maildir"].'/.ispconfig_mailsize_save')) unlink($rec["maildir"].'/.ispconfig_mailsize_save');
// Save the traffic stats in the sql database
$tstamp = date("Y-m");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment