added obscure ASCII encoding aliases, added more error checking to RFC2822 date parsing
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // check if config files had errors |
| | | if ($err_str = $RCMAIL->config->get_error()) { |
| | | raise_error(array( |
| | |
| | | 'type' => 'db', |
| | | 'message' => $err_str), FALSE, TRUE); |
| | | } |
| | | |
| | | |
| | | // error steps |
| | | if ($RCMAIL->action=='error' && !empty($_GET['_code'])) { |
| | |
| | | |
| | | $aliases = array( |
| | | 'US-ASCII' => 'ISO-8859-1', |
| | | 'ANSI_X3.110-1983' => 'ISO-8859-1', |
| | | 'ANSI_X3.4-1968' => 'ISO-8859-1', |
| | | 'UNKNOWN-8BIT' => 'ISO-8859-15', |
| | | 'X-UNKNOWN' => 'ISO-8859-15', |
| | | 'X-USER-DEFINED' => 'ISO-8859-15', |
| | |
| | | $ts = $date; |
| | | else if (!empty($date)) |
| | | { |
| | | while (($ts = @strtotime($date))===false) |
| | | { |
| | | // if we have a date in non-rfc format |
| | | // if date parsing fails, we have a date in non-rfc format. |
| | | // remove token from the end and try again |
| | | while ((($ts = @strtotime($date))===false) || ($ts < 0)) |
| | | { |
| | | $d = explode(' ', $date); |
| | | array_pop($d); |
| | | if (!$d) break; |
| | |
| | | // try to open specific log file for writing |
| | | if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a')) { |
| | | fwrite($fp, $log_entry); |
| | | fflush($fp); |
| | | fclose($fp); |
| | | } |
| | | } |
| | |
| | | $headers = &$this->get_cached_message($cache_key, $uid, true); |
| | | |
| | | // return cached message structure |
| | | if (is_object($headers) && is_object($headers->structure)) |
| | | if (is_object($headers) && is_object($headers->structure)) { |
| | | return $headers->structure; |
| | | } |
| | | |
| | | // resolve message sequence number |
| | | if (!($msg_id = $this->_uid2id($uid))) |
| | | if (!($msg_id = $this->_uid2id($uid))) { |
| | | return FALSE; |
| | | } |
| | | |
| | | $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); |
| | | $structure = iml_GetRawStructureArray($structure_str); |
| | |
| | | //Concat the double quotes and encoded string together |
| | | $hdr_value = $quotePrefix . $hdr_value . $quoteSuffix; |
| | | |
| | | |
| | | $hdr_value_out = $hdr_value; |
| | | $realMax = $maxLength1stLine + strlen($prefix . $suffix); |
| | | if (strlen($hdr_value_out) >= $realMax) { |