Revert "* Mail/Sieve: fix vacation message with redirect kept mail in INBOX, even if rule moved it to a folder"

Cause mails never to be left in INBOX :(

This reverts commit 41e102f015.
This commit is contained in:
ralf 2023-11-29 16:59:59 +02:00
parent 2aedd7f5ef
commit bca70c7b86

View File

@ -276,11 +276,7 @@ class Script
if (!$this->extensions['vacation']) $this->vacation = false;
// for vacation with redirect we need to keep track were the mail goes, to add an explicit keep
if ($this->extensions['variables'] && $this->vacation)
{
$newscriptbody = 'set "action" "inbox";'."\n\n";
}
$newscriptbody = "";
$continue = 1;
foreach ($this->rules as $rule) {
@ -409,16 +405,7 @@ class Script
if (preg_match("/flags/i",$rule['action'])) {
$newruletext .= "addflag \"".$rule['action_arg']."\";";
}
if ($rule['keep'])
{
$newruletext .= "\n\tkeep;";
}
// for vacation with redirect we need to keep track were the mail goes, to NOT add an explicit keep
elseif ($this->extensions['variables'] && $this->vacation &&
preg_match('/(folder|reject|address|discard)/', $rule['action']))
{
$newruletext .= "\n\tset \"action\" \"$rule[action]\";";
}
if ($rule['keep']) $newruletext .= "\n\tkeep;";
if (!$rule['unconditional']) $newruletext .= "\n}";
$continue = 0;
@ -481,11 +468,7 @@ class Script
{
$vac_rule .= "\tredirect \"" . trim($addr) . "\";\n";
}
// if there is no other action e.g. fileinto before, we need to add an explicit keep, as the implicit on is canceled by the vaction redirect!
if ($this->extensions['variables']) $vac_rule .= "\tif string :is \"action\" \"inbox\" {\n";
$vac_rule .= "\t\tkeep;\n";
if ($this->extensions['variables']) $vac_rule .= "\t}\n";
$vac_rule .= "}\n";
$vac_rule .= "\tkeep;\n}\n";
}
if (!isset($vacation['modus']) || $vacation['modus'] !== 'store')
{
@ -602,10 +585,9 @@ class Script
} else {
// no active rules, but might still have an active vacation rule
$closeRequired = false;
if ($this->vacation)
if ($this->vacation && $vacation_active)
{
$newscripthead .= "require [\"vacation\"";
if ($this->extensions['variables']) $newscripthead .= ',"variables"';
if ($this->extensions['regex'] && $regexused) $newscripthead .= ",\"regex\"";
if ($this->extensions['date']) $newscripthead .= ",\"date\"";
if ($this->extensions['relational']) $newscripthead .= ",\"relational\"";