| | |
| | | /** |
| | | * Connect to an IMAP server |
| | | * |
| | | * @param string $host Host to connect |
| | | * @param string $user Username for IMAP account |
| | | * @param string $pass Password for IMAP account |
| | | * @param integer $port Port to connect to |
| | | * @param string $use_ssl SSL schema (either ssl or tls) or null if plain connection |
| | | * @param string $host Host to connect |
| | | * @param string $user Username for IMAP account |
| | | * @param string $pass Password for IMAP account |
| | | * @param integer $port Port to connect to |
| | | * @param string $use_ssl SSL schema (either ssl or tls) or null if plain connection |
| | | * |
| | | * @return boolean TRUE on success, FALSE on failure |
| | | * @return boolean True on success, False on failure |
| | | */ |
| | | public function connect($host, $user, $pass, $port=143, $use_ssl=null) |
| | | { |
| | |
| | | public function index_direct($folder, $sort_field = null, $sort_order = null, $search = null) |
| | | { |
| | | if (!empty($search)) { |
| | | $search = $this->search_set->get_compressed(); |
| | | $search = $search->get_compressed(); |
| | | } |
| | | |
| | | // use message index sort as default sorting |
| | |
| | | |
| | | // @TODO: Honor MAXSIZE and DEPTH options |
| | | foreach ($queries as $attrib => $entry) { |
| | | if ($result = $this->conn->getAnnotation($folder, $entry, $attrib)) { |
| | | $res = array_merge_recursive($res, $result); |
| | | $result = $this->conn->getAnnotation($folder, $entry, $attrib); |
| | | |
| | | // an error, invalidate any previous getAnnotation() results |
| | | if (!is_array($result)) { |
| | | return null; |
| | | } |
| | | else { |
| | | foreach ($result as $fldr => $data) { |
| | | $res[$fldr] = array_merge((array) $res[$fldr], $data); |
| | | } |
| | | } |
| | | } |
| | | } |