| | |
| | | $this->conn = new rcube_imap_generic(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Connect to an IMAP server |
| | | * |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Close IMAP connection |
| | | * Usually done on script shutdown |
| | |
| | | $this->write_cache(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Close IMAP connection and re-connect |
| | | * This is used to avoid some strange socket errors when talking to Courier IMAP |
| | |
| | | { |
| | | return ($this->conn) ? $this->conn->error : ''; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Set options to be used in rcube_imap_generic::connect() |
| | |
| | | $this->options = array_merge($this->options, (array)$opt); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Set a root folder for the IMAP connection. |
| | | * |
| | |
| | | $this->get_hierarchy_delimiter(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Set default message charset |
| | | * |
| | |
| | | $this->default_charset = $cs; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * This list of folders will be listed above all other folders |
| | | * |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Set internal mailbox reference. |
| | | * |
| | |
| | | $this->_clear_messagecount($mailbox); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Forces selection of a mailbox |
| | | * |
| | | * @param string $mailbox Mailbox/Folder name |
| | | * @access public |
| | | */ |
| | | function select_mailbox($mailbox) |
| | | { |
| | | $mailbox = $this->mod_mailbox($mailbox); |
| | | |
| | | $selected = $this->conn->select($mailbox); |
| | | |
| | | if ($selected && $this->mailbox != $mailbox) { |
| | | // clear messagecount cache for this mailbox |
| | | $this->_clear_messagecount($mailbox); |
| | | $this->mailbox = $mailbox; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Set internal list page |
| | | * |
| | |
| | | $this->list_page = (int)$page; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Set internal page size |
| | | * |
| | |
| | | $this->page_size = (int)$size; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Save a set of message ids for future message listing methods |
| | | * |
| | |
| | | $this->search_sorted = $sorted; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Return the saved search set as hash array |
| | | * @return array Search set |
| | |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the currently used mailbox name |
| | | * |
| | |
| | | return $this->conn->connected() ? $this->mod_mailbox($this->mailbox, 'out') : ''; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the IMAP server's capability |
| | | * |
| | |
| | | return $this->conn->getCapability(strtoupper($cap)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sets threading flag to the best supported THREAD algorithm |
| | | * |
| | |
| | | return $this->threading; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Checks the PERMANENTFLAGS capability of the current mailbox |
| | | * and returns true if the given flag is supported by the IMAP server |
| | |
| | | return (in_array_nocase($imap_flag, $this->conn->data['PERMANENTFLAGS'])); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the delimiter that is used by the IMAP server for folder separation |
| | | * |
| | |
| | | return $this->delimiter; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get message count for a specific mailbox |
| | | * |
| | |
| | | return $this->_messagecount($mailbox, $mode, $force, $status); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Private method for getting nr of messages |
| | | * |