diff --git a/bureau/admin/mail_manage_catchall.php b/bureau/admin/mail_manage_catchall.php index 89b8d11c..bb180c89 100644 --- a/bureau/admin/mail_manage_catchall.php +++ b/bureau/admin/mail_manage_catchall.php @@ -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"); diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 08b80a8b..0402e820 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -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; } diff --git a/debian/changelog b/debian/changelog index ad7b09d8..75b669ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 20 Apr 2015 18:00:12 +0200