X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fcron_ml_moderate.php;h=30ffde82aa819e8d42799c0af79b5f8c3ba74776;hb=6f0ed746468397c663783a89f5b3b43f6fff77e2;hp=e2b261e990cada66def5a43eae6191c4e3e5961e;hpb=dc3441fff4abd8dc0a0c74a7958747b3a2a8fc81;p=platal.git diff --git a/bin/cron/cron_ml_moderate.php b/bin/cron/cron_ml_moderate.php index e2b261e..30ffde8 100755 --- a/bin/cron/cron_ml_moderate.php +++ b/bin/cron/cron_ml_moderate.php @@ -77,22 +77,6 @@ while ($sent_mails < $globals->lists->max_mail_per_min break; } - if ($client->handle_request($list, $mid, $action, $reason)) { - $sent_mails += $count; - $texte = "le message suivant :\n\n" - . " Auteur: {$mail['sender']}\n" - . " Sujet : « {$mail['subj']} »\n" - . " Date : ".strftime("le %d %b %Y à %H:%M:%S", (int)$mail['stamp'])."\n\n" - . $append; - $mailer = new PlMailer(); - $mailer->addTo("$list-owner@{$domain}"); - $mailer->setFrom("$list-bounces@{$domain}"); - $mailer->addHeader('Reply-To', "$list-owner@{$domain}"); - $mailer->setSubject($subject); - $mailer->setTxtBody($texte); - $mailer->send(); - } - // if the mail was classified as Unsure, feed bogo $raw_mail = html_entity_decode($client->get_pending_mail($list, $mid, 1)); // search for the X-Spam-Flag header @@ -101,7 +85,7 @@ while ($sent_mails < $globals->lists->max_mail_per_min $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') { @@ -113,6 +97,23 @@ while ($sent_mails < $globals->lists->max_mail_per_min $mailer->send(); } + // send feedback to the mailing list owners + if ($client->handle_request($list, $mid, $action, utf8_decode($reason))) { + $sent_mails += $count; + $texte = "le message suivant :\n\n" + . " Auteur: {$mail['sender']}\n" + . " Sujet : « {$mail['subj']} »\n" + . " Date : ".strftime("le %d %b %Y à %H:%M:%S", (int)$mail['stamp'])."\n\n" + . $append; + $mailer = new PlMailer(); + $mailer->addTo("$list-owner@{$domain}"); + $mailer->setFrom("$list-bounces@{$domain}"); + $mailer->addHeader('Reply-To', "$list-owner@{$domain}"); + $mailer->setSubject($subject); + $mailer->setTxtBody($texte); + $mailer->send(); + } + // release the lock XDB::execute("DELETE FROM ml_moderate WHERE handler = {?}", $handler);