refine anti-spam rule on vacation active; use regex with boundary

This commit is contained in:
Klaus Leithoff 2015-04-14 12:03:35 +00:00
parent 01e84c1ddb
commit 1116e46cdf

View File

@ -445,7 +445,8 @@ class emailadmin_script {
$newscriptbody .= "\tkeep;\n}\n"; $newscriptbody .= "\tkeep;\n}\n";
} }
$vacation_active = true; $vacation_active = true;
$newscriptbody .= "if header :contains ".'"X-Spam-Status" '.'"YES"'."{\n\tstop;\n}\n"; //stop vacation reply if it is spam //$newscriptbody .= "if header :contains ".'"X-Spam-Status" '.'"YES"'."{\n\tstop;\n}\n"; //stop vacation reply if it is spam
$newscriptbody .= "if header :regex ".'"X-Spam-Status" '.'"\\\\bYES\\\\b"'."{\n\tstop;\n}\n"; //stop vacation reply if it is spam
$newscriptbody .= "vacation :days " . $vacation['days'] . " :addresses ["; $newscriptbody .= "vacation :days " . $vacation['days'] . " :addresses [";
$first = 1; $first = 1;
foreach ($vacation['addresses'] as $vaddress) { foreach ($vacation['addresses'] as $vaddress) {
@ -522,7 +523,7 @@ class emailadmin_script {
if ($activerules) { if ($activerules) {
$newscripthead .= "require [\"fileinto\""; $newscripthead .= "require [\"fileinto\"";
if ($regexused) $newscripthead .= ",\"regex\""; if ($regexused||($this->vacation&& $vacation_active)) $newscripthead .= ",\"regex\"";
if ($rejectused) $newscripthead .= ",\"reject\""; if ($rejectused) $newscripthead .= ",\"reject\"";
if ($this->vacation && $vacation_active) { if ($this->vacation && $vacation_active) {
$newscripthead .= ",\"vacation\""; $newscripthead .= ",\"vacation\"";