X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Fmail%2Fpersonal%2Fmail%2Fclass_mail-methods-cyrus.inc;h=367917671e66b495d6afa983988031b47bab66b4;hb=4f9f3bf3404420ec2018894f95ccfc09259a3c78;hp=97e742771eae3c32a04b7dd9be9fec21807132f7;hpb=c498214bad9d9089bc0e8f8c658c5543531ce5b8;p=gosa.git 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 97e742771..367917671 100644 --- a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc +++ b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc @@ -247,10 +247,28 @@ class mailMethodCyrus extends mailMethod{ if ($list === FALSE){ @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "".$this->account_id."" , "IMAP: Add/Update account on server :".$this->MailServer); - if (!imap_createmailbox($this->imap_handle, $cfg["connect"]. $this->account_id)){ + if (!imap_createmailbox($this->imap_handle, $cfg["connect"].$this->account_id)){ $this->error = imap_last_error(); return(FALSE); } + + /* Autocreate configured default folders */ + $folders= $this->config->get_cfg_value("cyrusAutocreateFolders", null); + if ($folders) { + $foldersToCreate= explode(",", $folders); + $cyrus_delim= $this->cyrusUseSlashes?"/":"."; + + // Walk thru list of specified folders + foreach ($foldersToCreate as $folder) { + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "".$this->account_id."" , + "IMAP: Add/Update account folder ".$folder." on server :".$this->MailServer); + if(!imap_createmailbox($this->imap_handle, $cfg["connect"].$this->account_id.$cyrus_delim.$folder)) { + $this->error= imap_last_error(); + return(FALSE); + } + } + + } } } return(TRUE); @@ -530,7 +548,7 @@ class mailMethodCyrus extends mailMethod{ $script= ""; if (is_integer(strpos($gosaMailDeliveryMode, "R")) || is_integer(strpos($gosaMailDeliveryMode, "C")) || - !is_integer(strpos($gosaMailDeliveryMode, "L")) || + !is_integer(strpos($gosaMailDeliveryMode, "I")) || is_integer(strpos($gosaMailDeliveryMode, "V")) || is_integer(strpos($gosaMailDeliveryMode, "S"))){ @@ -569,7 +587,7 @@ class mailMethodCyrus extends mailMethod{ } /* If no local delivery is wanted, tell the script to discard the mail */ - if (!is_integer(strpos($gosaMailDeliveryMode, "L"))){ + if (!is_integer(strpos($gosaMailDeliveryMode, "I"))){ $text= preg_replace('/"/', '\\"', implode ("", file(CONFIG_DIR."/sieve-discard.txt"))); eval ("\$script.=\"$text\";"); }