| | |
| | | $count = iil_C_CountMessages($this->conn, $mailbox); |
| | | } |
| | | |
| | | if (is_array($a_mailbox_cache[$mailbox])) |
| | | if (!is_array($a_mailbox_cache[$mailbox])) |
| | | $a_mailbox_cache[$mailbox] = array(); |
| | | |
| | | $a_mailbox_cache[$mailbox][$mode] = (int)$count; |
| | |
| | | $mailbox = $mbox ? $this->_mod_mailbox($mbox) : $this->mailbox; |
| | | |
| | | // get cached headers |
| | | if ($headers = $this->get_cached_message($mailbox.'.msg', $uid)) |
| | | if ($is_uid && ($headers = $this->get_cached_message($mailbox.'.msg', $id))) |
| | | return $headers; |
| | | |
| | | $msg_id = $is_uid ? $this->_uid2id($id) : $id; |
| | |
| | | { |
| | | $mailbox = $this->_mod_mailbox($mbox); |
| | | |
| | | // make shure mailbox exists |
| | | // make sure mailbox exists |
| | | if (in_array($mailbox, $this->_list_mailboxes())) |
| | | $saved = iil_C_Append($this->conn, $mailbox, $message); |
| | | |
| | |
| | | $to_mbox = $this->_mod_mailbox($to_mbox); |
| | | $from_mbox = $from_mbox ? $this->_mod_mailbox($from_mbox) : $this->mailbox; |
| | | |
| | | // make shure mailbox exists |
| | | // make sure mailbox exists |
| | | if (!in_array($to_mbox, $this->_list_mailboxes())) |
| | | return FALSE; |
| | | |
| | | { |
| | | if (in_array(strtolower($to_mbox), $this->default_folders)) |
| | | $this->create_mailbox($to_mbox, TRUE); |
| | | else |
| | | return FALSE; |
| | | } |
| | | |
| | | // convert the list of uids to array |
| | | $a_uids = is_string($uids) ? explode(',', $uids) : (is_array($uids) ? $uids : NULL); |
| | | |
| | |
| | | |
| | | if ($msg_count>0) |
| | | { |
| | | $this->clear_message_cache($mailbox.'.msg'); |
| | | return iil_C_ClearFolder($this->conn, $mailbox); |
| | | $cleared = iil_C_ClearFolder($this->conn, $mailbox); |
| | | |
| | | // make sure the message count cache is cleared as well |
| | | if ($cleared) |
| | | { |
| | | $this->clear_message_cache($mailbox.'.msg'); |
| | | $a_mailbox_cache = $this->get_cache('messagecount'); |
| | | unset($a_mailbox_cache[$mailbox]); |
| | | $this->update_cache('messagecount', $a_mailbox_cache); |
| | | } |
| | | |
| | | return $cleared; |
| | | } |
| | | else |
| | | return 0; |
| | |
| | | // filter folders and sort them |
| | | $sa_unsubscribed = $this->_sort_mailbox_list($a_folders); |
| | | return $sa_unsubscribed; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get quota |
| | | * added by Nuny |
| | | */ |
| | | function get_quota() |
| | | { |
| | | if ($this->get_capability('QUOTA')) |
| | | { |
| | | $result = iil_C_GetQuota($this->conn); |
| | | return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]); |
| | | } |
| | | else |
| | | return 'unknown'; |
| | | } |
| | | |
| | | |
| | |
| | | $key, |
| | | $index, |
| | | $headers->uid, |
| | | substr($this->decode_header((string)$headers->subject, TRUE), 0, 128), |
| | | substr($this->decode_header((string)$headers->from, TRUE), 0, 128), |
| | | substr($this->decode_header((string)$headers->to, TRUE), 0, 128), |
| | | substr($this->decode_header((string)$headers->cc, TRUE), 0, 128), |
| | | (string)substr($this->decode_header($headers->subject, TRUE), 0, 128), |
| | | (string)substr($this->decode_header($headers->from, TRUE), 0, 128), |
| | | (string)substr($this->decode_header($headers->to, TRUE), 0, 128), |
| | | (string)substr($this->decode_header($headers->cc, TRUE), 0, 128), |
| | | (int)$headers->size, |
| | | serialize($headers)); |
| | | } |
| | |
| | | return trim($output); |
| | | } |
| | | |
| | | ?> |
| | | ?> |