fix catchall crappy & with bugguy error messages

This commit is contained in:
Benjamin Sonntag 2015-04-22 17:32:40 +02:00
parent f8c5872c99
commit f01accd4c2
3 changed files with 22 additions and 4 deletions

View File

@ -44,13 +44,28 @@ if (is_null($domain_id)) {
if (!is_null($target_type)) {
switch ($target_type) {
case "none":
$error=( ($mail->catchall_del($domain_id))?_("Catchall successfully deleted"):$err->errstr() );
$mail->catchall_del($domain_id);
$error=_("Catchall successfully deleted");
require_once("mail_list.php");
exit();
break;
case "domain":
$error=( ($mail->catchall_set($domain_id, $target_domain))?_("Catchall successfully updated"):$err->errstr() );
if ($mail->catchall_set($domain_id, $target_domain)) {
$error=_("Catchall successfully updated");
require_once("mail_list.php");
exit();
} else {
$error=$err->errstr();
}
break;
case "mail":
$error=( ($mail->catchall_set($domain_id, $target_mail))?_("Catchall successfully updated"):$err->errstr() );
if ($mail->catchall_set($domain_id, $target_mail)) {
$error=_("Catchall successfully updated");
require_once("mail_list.php");
exit();
} else {
$error=$err->errstr();
}
break;
default:
$error=_("Unknown target type");

View File

@ -187,6 +187,7 @@ class m_mail {
}
}
$this->catchall_del($domain_id);
$err->error="";
return $this->create_alias($domain_id, '', $target, "catchall", true);
}
@ -718,8 +719,9 @@ ORDER BY
$err->log("mail","create_alias","creating $m alias for $alias type $type");
$mail_id=$mail->create($dom_id,$m,$type,$dontcheck);
if (!$mail_id) return false;
$this->set_details($mail_id,0,0,$alias,"dovecot",$dontcheck);
// FIXME return error code
return true;
}

1
debian/changelog vendored
View File

@ -8,6 +8,7 @@ alternc (3.1.4) oldstable; urgency=low
* default message size limit to 100M, no mailbox size limit in postfix
* fix removal of awstats-package crontab in favor of AlternC's one
* fix unzip/untar/ungzip of files from the browser (double escapeshellarg)
* fix catchall management (bugguy & crappy error messages)
-- Benjamin Sonntag <benjamin@sonntag.fr> Mon, 20 Apr 2015 18:00:12 +0200