Commit d1489c30 authored by tbrehm's avatar tbrehm

Fixed: FS#676 - IMAP lists a .ispconfig_mailsize "folder"

parent 20e4a511
...@@ -46,7 +46,7 @@ if ( $RETURNCODE == 0 ) ...@@ -46,7 +46,7 @@ if ( $RETURNCODE == 0 )
} }
# Create a mailsize file # Create a mailsize file
`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/.ispconfig_mailsize` `echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize`
# #
......
...@@ -48,13 +48,13 @@ $app->uses('ini_parser,file,services'); ...@@ -48,13 +48,13 @@ $app->uses('ini_parser,file,services');
$sql = "SELECT mailuser_id,maildir FROM mail_user WHERE server_id = ".$conf["server_id"]; $sql = "SELECT mailuser_id,maildir FROM mail_user WHERE server_id = ".$conf["server_id"];
$records = $app->db->queryAllRecords($sql); $records = $app->db->queryAllRecords($sql);
foreach($records as $rec) { foreach($records as $rec) {
if(@is_file($rec["maildir"].'/.ispconfig_mailsize')) { if(@is_file($rec["maildir"].'/ispconfig_mailsize')) {
// rename file // 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 // Read the file
$lines = file($rec["maildir"].'/.ispconfig_mailsize_save'); $lines = file($rec["maildir"].'/ispconfig_mailsize_save');
$mail_traffic = 0; $mail_traffic = 0;
foreach($lines as $line) { foreach($lines as $line) {
$mail_traffic += intval($line); $mail_traffic += intval($line);
...@@ -62,7 +62,7 @@ foreach($records as $rec) { ...@@ -62,7 +62,7 @@ foreach($records as $rec) {
unset($lines); unset($lines);
// Delete backup file // 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 // Save the traffic stats in the sql database
$tstamp = date("Y-m"); $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