* Mail: warn user when there's no space left for storing sieve rules because of sieve_maxscriptsize limit

This commit is contained in:
Hadi Nategh 2018-06-15 15:49:34 +02:00
parent aea2b4d216
commit 8f53e3d9f1
2 changed files with 7 additions and 2 deletions

View File

@ -607,7 +607,12 @@ class Script
//error_log(__METHOD__.__LINE__.array2string($newscript));
//print "<pre>$newscript</pre>"; exit;
//print "<hr><pre>".htmlentities($newscript)."</pre><hr>";
try {
if (!$connection->hasSpace($this->name, mb_strlen($newscript)))
{
throw new \Exception(lang("There is no space left to store sieve script, please check sieve_maxscriptsize option on your mailserver's config."));
}
$connection->installScript($this->name, $newscript, true);
}
catch (\Exception $e) {

View File

@ -963,7 +963,7 @@ class mail_sieve
if($result)
{
$response->error($result);
$response->message($result);
return;
}
$this->saveSessionData();
@ -1170,7 +1170,7 @@ class mail_sieve
{
if (!$this->account->imapServer()->setRules($this->rules))
{
return "update failed";
return $this->account->imapServer()->error;
}
}