From: hickert Date: Thu, 11 Dec 2008 11:51:04 +0000 (+0000) Subject: Check for valid imap servers. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a2e34a082edcfd8666bafac3d732043b4a31da4e;p=gosa.git Check for valid imap servers. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13258 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc index 152daee4d..838760218 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -25,15 +25,22 @@ class mailMethodCyrus extends mailMethod{ protected function init() { mailMethod::init(); - $this->ServerList = $this->config->data['SERVERS']['IMAP']; + if(isset($this->config->data['SERVERS']['IMAP'])){ + $this->ServerList = $this->config->data['SERVERS']['IMAP']; + } } public function connect() { mailMethod::connect(); - - if (!isset($this->ServerList[$this->MailServer])){ + + if(!count($this->ServerList)){ + $this->error = _("There are no imap compatible mail servers defined!"); + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, + "IMAP: No mail servers configured, check systems->server->service->imap.",""); + return(FALSE); + }elseif (!isset($this->ServerList[$this->MailServer])){ $this->error = _("Mail server for this account is invalid!"); @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "IMAP: The selected mail server '".$this->MailServer."' is invalid.","");