From 5199c520c8f0cb018893761351b45e0f4aa58f71 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 6 Nov 2003 10:50:05 +0000 Subject: [PATCH] debug code, new autoreply try --- philter/philter/include/philter.inc.php | 3 --- philter/philter/include/plugin_autoreply.inc.php | 16 ++++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/philter/philter/include/philter.inc.php b/philter/philter/include/philter.inc.php index 4a71714..2ad95a3 100644 --- a/philter/philter/include/philter.inc.php +++ b/philter/philter/include/philter.inc.php @@ -93,9 +93,6 @@ class Philter { fwrite($f, $procmail, strlen($procmail)); fclose($f); rename($file.".tmp", $file); - echo "
\n";
-        echo $procmail;
-        echo "
\n"; return true; } diff --git a/philter/philter/include/plugin_autoreply.inc.php b/philter/philter/include/plugin_autoreply.inc.php index 3cbccc9..3151f34 100644 --- a/philter/philter/include/plugin_autoreply.inc.php +++ b/philter/philter/include/plugin_autoreply.inc.php @@ -31,15 +31,19 @@ EOF; function to_string($_data) { $uid = get_user_id(); - $text = explode("\n",$_data[1]); + + $text = addslashes($_data[1]); + $text = str_replace('$', '\$', $text); + $lines = split("\n", $text); $res = " if(! /^X-Philter-Autoreply: $uid$/)\n" # TODO : et ne vient pas da démon . " {\n" - . " cc \"| reformail -rt -A'X-Philter-Autoreply: $uid' \\\n" - . " | ( cat - ; echo '' ; \\\n"; - foreach($text as $line) - $res .= " echo ".escapeshellarg(chop($line))."; \\\n"; - $res.= " ) | $"."SENDMAIL -oi -t\"\n"; + . " cc \"| reformail -rt -A'X-Philter-Autoreply: $uid' -A'X-Precedence: junk' \\\n" + . " | ( cat - ; echo '';"; + foreach($lines as $line) + $res .= " echo '".chop($line)."';"; + $res.= " \\\n" + . " ) | $"."SENDMAIL -oi -t\"\n"; return $res." }\n"; } } -- 2.1.4