summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authortill <till@php.net>2008-02-12 00:03:43 +0000
committertill <till@php.net>2008-02-12 00:03:43 +0000
commit90180eff2f9e7dcf4112c815a94dce774deeda21 (patch)
treef3a37b9a7d135d12a1301a7970a998820d0f3b1d /program/lib
parent6f9926357c8fdd71ae3ede4c3811198974c2df43 (diff)
* added bad_date_display.patch from #1484577
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/imap.inc20
1 files changed, 16 insertions, 4 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index a2a63d92e..39a4cb498 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -1520,7 +1520,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false) {
$request .= " FETCH $message_set (BODY.PEEK[HEADER.FIELDS ";
$request .= "(DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC ";
$request .= "CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID ";
- $request .= "REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY)])\r\n";
+ $request .= "REFERENCES RECEIVED DISPOSITION-NOTIFICATION-TO X-PRIORITY)])\r\n";
if (!fputs($fp, $request)) {
return false;
@@ -1547,7 +1547,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false) {
$line = chop(iil_ReadLine($fp, 300), "\r\n");
if (ord($line[0])<=32) {
$lines[$i] .= (empty($lines[$i])?'':"\n").trim(chop($line));
- } else{
+ } else {
$i++;
$lines[$i] = trim(chop($line));
}
@@ -1564,14 +1564,17 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false) {
if (preg_match("/^\s*UID [0-9]+\)$/",$line)) {
break;
}
- } while (trim($line[0]) != ')' && strncmp($line, $key, strlen($key))); // patch from "Maksim Rubis" <siburny@hotmail.com>
+ // patch from "Maksim Rubis" <siburny@hotmail.com>
+ } while (trim($line[0]) != ')' && strncmp($line, $key, strlen($key)));
if (strncmp($line, $key, strlen($key))) {
//process header, fill iilBasicHeader obj.
// initialize
if (is_array($headers)) {
reset($headers);
- while ( list($k, $bar) = each($headers) ) $headers[$k] = '';
+ while (list($k, $bar) = each($headers)) {
+ $headers[$k] = '';
+ }
}
// create array with header field:data
@@ -1585,6 +1588,15 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false) {
$result[$id]->date = $string;
$result[$id]->timestamp = iil_StrToTime($string);
break;
+ case 'received':
+ if (!isset($result[$id]->date)) {
+ $_received = substr(strstr(str_replace("\n",
+ '', $string), '; '), 2);
+
+ $result[$id]->date = str_replace("\n", '', $_received);
+ $result[$id]->timestamp = iil_StrToTime($_received);
+ }
+ break;
case 'from':
$result[$id]->from = $string;
break;