| | |
| | | $attempt = 0; |
| | | do { |
| | | $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', |
| | | array('host' => $host, 'user' => $user, 'attempt' => ++$attempt)); |
| | | array_merge($this->options, array('host' => $host, 'user' => $user, |
| | | 'attempt' => ++$attempt))); |
| | | |
| | | if (!empty($data['pass'])) |
| | | $pass = $data['pass']; |
| | | |
| | | $this->conn->connect($data['host'], $data['user'], $pass, $this->options); |
| | | $this->conn->connect($data['host'], $data['user'], $pass, $data); |
| | | } while(!$this->conn->connected() && $data['retry']); |
| | | |
| | | $this->host = $data['host']; |
| | |
| | | $mailbox = $this->mailbox; |
| | | } |
| | | |
| | | return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, false, $slice); |
| | | return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, $slice); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | if (!empty($parents)) { |
| | | $headers[$idx]->parent_uid = end($parents); |
| | | if (!$header->seen) |
| | | if (empty($header->flags['SEEN'])) |
| | | $headers[$parents[0]]->unread_children++; |
| | | } |
| | | array_push($parents, $header->uid); |
| | |
| | | // use message index sort as default sorting |
| | | if (!$sort_field) { |
| | | if ($this->skip_deleted) { |
| | | $a_index = $this->_search_index($mailbox, 'ALL'); |
| | | $a_index = $this->conn->search($mailbox, 'ALL UNDELETED'); |
| | | // I didn't found that SEARCH should return sorted IDs |
| | | if (is_array($a_index)) |
| | | sort($a_index); |
| | | } else if ($max = $this->_messagecount($mailbox)) { |
| | | $a_index = range(1, $max); |
| | | } |
| | |
| | | if ($this->conn->selected != $mailbox) { |
| | | if ($this->conn->select($mailbox)) |
| | | $this->mailbox = $mailbox; |
| | | else |
| | | return null; |
| | | } |
| | | |
| | | $data = $this->conn->data; |
| | |
| | | |
| | | |
| | | /** |
| | | * Synchronizes messages cache. |
| | | * |
| | | * @param string $mailbox Folder name |
| | | */ |
| | | public function mailbox_sync($mailbox) |
| | | { |
| | | if ($mcache = $this->get_mcache_engine()) { |
| | | $mcache->synchronize($mailbox); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get message header names for rcube_imap_generic::fetchHeader(s) |
| | | * |
| | | * @return string Space-separated list of header names |