| | |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube_imap.php | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | // write error log |
| | | else if ($this->conn->error) { |
| | | $this->error_code = $this->conn->errornum; |
| | | raise_error(array('code' => 403, 'type' => 'imap', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => $this->conn->error), true, false); |
| | | if ($pass && $user) |
| | | raise_error(array('code' => 403, 'type' => 'imap', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => $this->conn->error), true, false); |
| | | } |
| | | |
| | | return false; |
| | |
| | | */ |
| | | function close() |
| | | { |
| | | if ($this->conn && $this->conn->connected()) |
| | | $this->conn->close(); |
| | | $this->conn->close(); |
| | | $this->write_cache(); |
| | | } |
| | | |
| | |
| | | |
| | | // fetch complete headers and add to cache |
| | | if (!empty($for_update)) { |
| | | if ($headers = $this->conn->fetchHeader($mailbox, |
| | | join(',', $for_update), false, $this->fetch_add_headers)) { |
| | | if ($headers = $this->conn->fetchHeaders($mailbox, |
| | | join(',', $for_update), false, false, $this->fetch_add_headers)) { |
| | | foreach ($headers as $header) { |
| | | $this->add_message_cache($cache_key, $header->id, $header, NULL, |
| | | in_array($header->uid, (array)$for_remove)); |
| | |
| | | // featch headers if unserialize failed |
| | | if (empty($this->cache[$cache_key][$uid])) |
| | | $this->cache[$cache_key][$uid] = $this->conn->fetchHeader( |
| | | preg_replace('/.msg$/', '', $key), $uid, true, $this->fetch_add_headers); |
| | | preg_replace('/.msg$/', '', $key), $uid, true, false, $this->fetch_add_headers); |
| | | } |
| | | } |
| | | |
| | |
| | | $name = trim($val['name']); |
| | | |
| | | if (preg_match('/^[\'"]/', $name) && preg_match('/[\'"]$/', $name)) |
| | | $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', $name); |
| | | $name = trim($name, '\'"'); |
| | | |
| | | if ($name && $address && $name != $address) |
| | | $string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address); |
| | |
| | | function decode_header($input, $remove_quotes=false) |
| | | { |
| | | $str = rcube_imap::decode_mime_string((string)$input, $this->default_charset); |
| | | if ($str{0}=='"' && $remove_quotes) |
| | | if ($str[0] == '"' && $remove_quotes) |
| | | $str = str_replace('"', '', $str); |
| | | |
| | | return $str; |