Bugfixes in the analysis of sendmail logs.
[gnucomo.git] / src / gcm_daemon / classes / gnucomo.process_log.php
index 8fa7329..2dec2de 100644 (file)
@@ -164,7 +164,7 @@ function linux_daemon_sendmail()
            $local_logline_array[$i] = trim($local_dummy);
         }
 
-        if (substr($local_logline_array[$i],0,1) == '[')
+        if (substr($local_logline_array[$i],0,1) == '[' && strstr($local_sql_2, "source_ip") == false)
         {
           $local_dummy = trim($local_logline_array[$i]);
           $local_sql_2 .= ", source_ip";
@@ -179,7 +179,7 @@ function linux_daemon_sendmail()
            {
            case "from":
               $local_sql_2 .= ", from_email";
-              $local_sql_3 .= ", '".$local_element[1]."'";
+              $local_sql_3 .= ", '". addslashes($local_element[1]) ."'";
               break;
 
            case "size":
@@ -189,12 +189,12 @@ function linux_daemon_sendmail()
 
            case "delay":
               $local_sql_2 .= ", delay";
-              $local_sql_3 .= ", '".ereg_replace("+", " ", $local_element[1])."'";
+              $local_sql_3 .= ", '".ereg_replace("\+", " ", $local_element[1])."'";
               break;
 
            case "xdelay":
               $local_sql_2 .= ", xdelay";
-              $local_sql_3 .= ", '".ereg_replace("+", " ", $local_element[1])."'";
+              $local_sql_3 .= ", '".ereg_replace("\+", " ", $local_element[1])."'";
               break;
 
            case "mailer":