From: cajus Date: Wed, 9 Dec 2009 15:06:18 +0000 (+0000) Subject: Inluding tuned version of patch from #808 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e12371084aa08fb06efc82f67d16ade8784221ac;p=gosa.git Inluding tuned version of patch from #808 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14888 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 97e742771..a5cf20e2b 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,26 @@ 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) { + if(!imap_createmailbox($this->imap_handle, $cfg["connect"].$this->account_id.$cyrus_delim.$folder)) { + $this->error= imap_last_error(); + return(FALSE); + } + } + + } } } return(TRUE);