Increase memory limit to be able to load emails with large attachments
authorAymeric Augustin <aymeric.augustin@m4x.org>
Sun, 20 Apr 2008 13:53:32 +0000 (15:53 +0200)
committerAymeric Augustin <aymeric.augustin@m4x.org>
Sun, 20 Apr 2008 13:53:32 +0000 (15:53 +0200)
Fix indentation

bin/cron/cron_ml_moderate.php

index 03f2c71..e2b261e 100755 (executable)
@@ -22,6 +22,7 @@
 
 require('./connect.db.inc.php');
 ini_set('max_execution_time', '75');
+ini_set('memory_limit', '128M');
 $sent_mails = 0;
 $handler    = time();
 
@@ -96,19 +97,21 @@ while ($sent_mails < $globals->lists->max_mail_per_min
     $raw_mail = html_entity_decode($client->get_pending_mail($list, $mid, 1));
     // search for the X-Spam-Flag header
     $end_of_headers = strpos($raw_mail, "\r\n\r\n");
-    if ($end_of_headers === false)     // sometimes headers are separated by \n
+    if ($end_of_headers === false) {   // sometimes headers are separated by \n
         $end_of_headers = strpos($raw_mail, "\n\n");
+    }
     $x_spam_flag = '';
-    if (preg_match('/^X-Spam-Flag: ([a-zA-Z]+), tests=bogofilter/m', substr($raw_mail, 0, $end_of_headers + 1), $matches))
+    if (preg_match('/^X-Spam-Flag: ([a-zA-Z]+), tests=bogofilter/m', substr($raw_mail, 0, $end_of_headers + 1), $matches) {
         $x_spam_flag = $matches[1];
+    }
     if ($x_spam_flag == 'Unsure') {
-            $mailer = new PlMailer();
-            $mailer->addTo($type . '@' . $globals->mail->domain);
-            $mailer->setFrom('"' . $prenom . ' ' . $nom . '" <web@' . $globals->mail->domain . '>');
-            $mailer->setTxtBody($type . ' soumis par ' . $prenom . ' ' . $nom . ' via la modération de la liste ' . $list . '@' . $domain);
-            $mailer->addAttachment($raw_mail, 'message/rfc822', $type . '.mail', false);
-            $mailer->send();
-        }
+        $mailer = new PlMailer();
+        $mailer->addTo($type . '@' . $globals->mail->domain);
+        $mailer->setFrom('"' . $prenom . ' ' . $nom . '" <web@' . $globals->mail->domain . '>');
+        $mailer->setTxtBody($type . ' soumis par ' . $prenom . ' ' . $nom . ' via la modération de la liste ' . $list . '@' . $domain);
+        $mailer->addAttachment($raw_mail, 'message/rfc822', $type . '.mail', false);
+        $mailer->send();
+    }
 
     // release the lock
     XDB::execute("DELETE FROM ml_moderate WHERE handler = {?}",