From: Aymeric Augustin Date: Sun, 20 Jul 2008 20:02:02 +0000 (+0200) Subject: Fix bogo automatic feeding: send email to (non)spam@ before removing it from the... X-Git-Tag: xorg/0.9.17~24 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9c34c68a20049382c6171e263f692c0a5b4838ca;p=platal.git Fix bogo automatic feeding: send email to (non)spam@ before removing it from the moderation queue. --- diff --git a/bin/cron/cron_ml_moderate.php b/bin/cron/cron_ml_moderate.php index 4891bdc..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, 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(); - } - // 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 @@ -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);