Example #1
0
 /**
  * Create a new mailbox on the server and register it in local cache
  *
  * @param string  $name      New mailbox name
  * @param boolean $subscribe True if the new mailbox should be subscribed
  * @param boolean True on success
  */
 function create_mailbox($name, $subscribe = false)
 {
     $result = false;
     $abs_name = $this->mod_mailbox($name);
     $result = $this->conn->createFolder($abs_name);
     // try to subscribe it
     if ($result && $subscribe) {
         $this->subscribe($name);
     }
     return $result;
 }
Example #2
0
 /**
  * Create a new mailbox on the server and register it in local cache
  *
  * @param string  $mailbox   New mailbox name
  * @param boolean $subscribe True if the new mailbox should be subscribed
  *
  * @return boolean True on success
  */
 function create_mailbox($mailbox, $subscribe = false)
 {
     $result = $this->conn->createFolder($mailbox);
     // try to subscribe it
     if ($result) {
         // clear cache
         $this->clear_cache('mailboxes', true);
         if ($subscribe) {
             $this->subscribe($mailbox);
         }
     }
     return $result;
 }
Example #3
0
 /**
  * Create a new folder on the server and register it in local cache
  *
  * @param string  $folder    New folder name
  * @param boolean $subscribe True if the new folder should be subscribed
  * @param string  $type      Optional folder type (junk, trash, drafts, sent, archive)
  *
  * @return boolean True on success
  */
 public function create_folder($folder, $subscribe = false, $type = null)
 {
     if (!$this->check_connection()) {
         return false;
     }
     $result = $this->conn->createFolder($folder, $type ? array("\\" . ucfirst($type)) : null);
     // try to subscribe it
     if ($result) {
         // clear cache
         $this->clear_cache('mailboxes', true);
         if ($subscribe) {
             $this->subscribe($folder);
         }
     }
     return $result;
 }
Example #4
0
 /**
  * Create a new folder on the server and register it in local cache
  *
  * @param string  $folder    New folder name
  * @param boolean $subscribe True if the new folder should be subscribed
  * @param string  $type      Optional folder type (junk, trash, drafts, sent, archive)
  *
  * @return boolean True on success
  */
 public function create_folder($folder, $subscribe = false, $type = null)
 {
     if (!$this->check_connection()) {
         return false;
     }
     $result = $this->conn->createFolder($folder, $type ? array("\\" . ucfirst($type)) : null);
     // it's quite often situation that we're trying to create and subscribe
     // a folder that already exist, but is unsubscribed
     if (!$result) {
         if ($this->get_response_code() == rcube_storage::ALREADYEXISTS || preg_match('/already exists/i', $this->get_error_str())) {
             $result = true;
         }
     }
     // try to subscribe it
     if ($result) {
         // clear cache
         $this->clear_cache('mailboxes', true);
         if ($subscribe) {
             $this->subscribe($folder);
         }
     }
     return $result;
 }