From: hickert Date: Thu, 14 Feb 2008 13:18:28 +0000 (+0000) Subject: Updated mail methods. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=87bfd6f3d90ff2861624d10e77bcb045e0852351;p=gosa.git Updated mail methods. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8911 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 3b7e8b083..c73154f64 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -30,9 +30,15 @@ class mailMethodCyrus extends mailMethod /* Check if the mail account identification attribute is overridden in the configuration file */ - if(isset($config->current['MAIL_ATTRIB'])){ - $this->uattrib = $config->current['MAIL_ATTRIB']; + if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){ + $new_uattrib= strtolower($config->current['MAIL_ATTRIB']); + if(in_array($new_uattrib,array("mail","uid"))){ + $this->uattrib = $new_uattrib; + }else{ + trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.", $new_uattrib)); + } } + $this->config= $config->data['SERVERS']['IMAP']; } diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-sendmail-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-sendmail-cyrus.inc index b70dfc14b..6cc776d0e 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-sendmail-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-sendmail-cyrus.inc @@ -26,9 +26,15 @@ class mailMethodSendmailCyrus extends mailMethodCyrus /* Check if the mail account identification attribute is overridden in the configuration file */ - if(isset($config->current['MAIL_ATTRIB'])){ - $this->uattrib = $config->current['MAIL_ATTRIB']; + if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){ + $new_uattrib= strtolower($config->current['MAIL_ATTRIB']); + if(in_array($new_uattrib,array("mail","uid"))){ + $this->uattrib = $new_uattrib; + }else{ + trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.", $new_uattrib)); + } } + $this->config= $config->data['SERVERS']['IMAP']; } diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc index ebc9dc13f..7f58a4520 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods.inc @@ -28,8 +28,13 @@ class mailMethod /* Check if the mail account identification attribute is overridden in the configuration file */ - if(isset($config->current['MAIL_ATTRIB'])){ - $this->uattrib = $config->current['MAIL_ATTRIB']; + if(isset($config->current['MAIL_ATTRIB']) && !empty($config->current['MAIL_ATTRIB'])){ + $new_uattrib= strtolower($config->current['MAIL_ATTRIB']); + if(in_array($new_uattrib,array("mail","uid"))){ + $this->uattrib = $new_uattrib; + }else{ + trigger_error(sprintf("Unsupported MAIL_ATTRIB in gosa configuration specified, use 'mail' or 'uid', instead of '%s'.", $new_uattrib)); + } } }