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 e054fa29ef85ecd45e0456e9e1a40e4eb6127e78..367917671e66b495d6afa983988031b47bab66b4 100644 (file)
if ($list === FALSE){
@DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "<b>".$this->account_id."</b>" ,
"<b>IMAP: Add/Update account</b> 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__, "<b>".$this->account_id."</b>" ,
+ "<b>IMAP: Add/Update account folder ".$folder."</b> 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);
$cfg= $this->ServerList[$this->MailServer];
@imap_setacl ($this->imap_handle, $this->account_id, $cfg["admin"], "lrswipcda");
- if (!imap_deletemailbox($this->imap_handle, $cfg["connect"].$this->account_id)){
- $this->error = imap_last_error();
- return (FALSE);
+
+ if ($this->config->get_cfg_value("cyrusDeleteMailbox", "true") == "true"){
+ if (!imap_deletemailbox($this->imap_handle, $cfg["connect"].$this->account_id)){
+ $this->error = imap_last_error();
+ return (FALSE);
+ }
+ } else{
+ msg_dialog::display(_("Mail info"),
+ sprintf(_("LDAP entry has been removed but cyrus mailbox (%s) is kept.\nPlease delete it manually!"),
+ $this->account_id), INFO_DIALOG);
}
return (TRUE);
}
$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"))){
}
/* 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\";");
}