Mail log problem

Discussion in 'Installation/Configuration' started by sfrank, Jan 11, 2008.

  1. sfrank

    sfrank New Member

    Hi,

    How can I tell ISPConfig not to create mail.log.$date files after mail_logs.php is run?
    I've got 2 installations of ISPConfig 2.2.17. On one of them it creates these files while on the other it does not.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Uncheck the save mail log checkbox under management > server > settings on the mail log.
     
  3. sfrank

    sfrank New Member

    That was the first thing I did, but according to the documentation it is responsible only for the mail.log.ispconfigsave file anyway:

    " The log file will then be saved with the extension ".ispconfigsave" in the same directory."

    The "Save log" option is off on both systems, still the .$date files get created only on one of them. I even checked the mail_save_log field in the isp_server table, and its value is indeed 0 in both cases.
     
  4. xrat

    xrat Member

    If I read /root/ispconfig/scripts/shell/mail_logs.php correctly, then it always creates a copy with date (here $datum) appended. Line 53 (in v2.2.18) and subsequent lines:
    Code:
    $mod->log->caselog("cp -f $dist_mail_log $dist_mail_log.$datum", $FILE, __LINE__);
    if($server["server_mail_log_save"]){
      $mod->log->caselog("touch $dist_mail_log.ispconfigsave", $FILE, __LINE__);
      $mod->log->caselog("cat $dist_mail_log >> $dist_mail_log.ispconfigsave", $FILE, __LINE__);
    }
    As you can see only the creation of $dist_mail_log.ispconfigsave depends on server_mail_log_save.

    But $dist_mail_log.$datum should be -- again unconditionally -- removed, in fact the script tries this two times by means of
    Code:
    exec("rm -f $dist_mail_log.$datum");
    Once at line 67 and again at the end.

    So, if I am right then the fact that you find these files in /var/log (or whatever) means that the script breaks before it can remove them.

    Disclaimer: I am only a user when it comes to ISPconfig. And, I have only quickly looked into mail_logs.php because I try to track down the mail.log rotation bug.

    HTH.
     
  5. sfrank

    sfrank New Member

    I'll take a look into this, thanks.
     
  6. sfrank

    sfrank New Member

    I finally managed to fix this. After un-muting the cron job, the error message revealed that the script was running out of memory due to the limit in /root/ispconfig/php/php.ini and got interrupted in the middle of execution (before running rm on the temp log files).

    Increasing the limit solved this issue.
     

Share This Page