Code

Updated mail methods.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Feb 2008 13:18:28 +0000 (13:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Feb 2008 13:18:28 +0000 (13:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8911 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc
gosa-plugins/mail/personal/mail/class_mail-methods-sendmail-cyrus.inc
gosa-plugins/mail/personal/mail/class_mail-methods.inc

index 3b7e8b08329014f3d22f7fdd1e827a089a76c994..c73154f6420e23f65f1ff4604f866af6e47ec818 100644 (file)
@@ -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'];
   }
 
index b70dfc14bcb1b1f9933422c8971f5ca51cf3895b..6cc776d0ece725fb4a659ac7ce76ce9a741f6eb0 100644 (file)
@@ -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'];
   }
 
index ebc9dc13fe11e9f1f2a072180dd89ebe64c0ca7e..7f58a4520274b839ba79906308347e81c56e2201 100644 (file)
@@ -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));
+      }
     }
   }