mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-20 21:08:54 +01:00
Fix "* Mail/Sieve: fix vacation message with redirect kept mail in INBOX, even if rule moved it to a folder"
This commit is contained in:
parent
a6104f6727
commit
9947a92f38
@ -276,7 +276,11 @@ class Script
|
|||||||
|
|
||||||
if (!$this->extensions['vacation']) $this->vacation = false;
|
if (!$this->extensions['vacation']) $this->vacation = false;
|
||||||
|
|
||||||
$newscriptbody = "";
|
// 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";
|
||||||
|
}
|
||||||
$continue = 1;
|
$continue = 1;
|
||||||
|
|
||||||
foreach ($this->rules as $rule) {
|
foreach ($this->rules as $rule) {
|
||||||
@ -405,7 +409,16 @@ class Script
|
|||||||
if (preg_match("/flags/i",$rule['action'])) {
|
if (preg_match("/flags/i",$rule['action'])) {
|
||||||
$newruletext .= "addflag \"".$rule['action_arg']."\";";
|
$newruletext .= "addflag \"".$rule['action_arg']."\";";
|
||||||
}
|
}
|
||||||
if ($rule['keep']) $newruletext .= "\n\tkeep;";
|
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['unconditional']) $newruletext .= "\n}";
|
if (!$rule['unconditional']) $newruletext .= "\n}";
|
||||||
|
|
||||||
$continue = 0;
|
$continue = 0;
|
||||||
@ -468,7 +481,11 @@ class Script
|
|||||||
{
|
{
|
||||||
$vac_rule .= "\tredirect \"" . trim($addr) . "\";\n";
|
$vac_rule .= "\tredirect \"" . trim($addr) . "\";\n";
|
||||||
}
|
}
|
||||||
$vac_rule .= "\tkeep;\n}\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";
|
||||||
}
|
}
|
||||||
if (!isset($vacation['modus']) || $vacation['modus'] !== 'store')
|
if (!isset($vacation['modus']) || $vacation['modus'] !== 'store')
|
||||||
{
|
{
|
||||||
@ -585,9 +602,10 @@ class Script
|
|||||||
} else {
|
} else {
|
||||||
// no active rules, but might still have an active vacation rule
|
// no active rules, but might still have an active vacation rule
|
||||||
$closeRequired = false;
|
$closeRequired = false;
|
||||||
if ($this->vacation && $vacation_active)
|
if ($this->vacation)
|
||||||
{
|
{
|
||||||
$newscripthead .= "require [\"vacation\"";
|
$newscripthead .= "require [\"vacation\"";
|
||||||
|
if ($this->extensions['variables']) $newscripthead .= ',"variables"';
|
||||||
if ($this->extensions['regex'] && $regexused) $newscripthead .= ",\"regex\"";
|
if ($this->extensions['regex'] && $regexused) $newscripthead .= ",\"regex\"";
|
||||||
if ($this->extensions['date']) $newscripthead .= ",\"date\"";
|
if ($this->extensions['date']) $newscripthead .= ",\"date\"";
|
||||||
if ($this->extensions['relational']) $newscripthead .= ",\"relational\"";
|
if ($this->extensions['relational']) $newscripthead .= ",\"relational\"";
|
||||||
|
Loading…
Reference in New Issue
Block a user