From 8fca0a655858da407d32d6d165c326a1c8738f73 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sat, 23 Sep 2000 00:50:23 +0000 Subject: [PATCH] if no date is sent in the header of a message, it takes the IMAP server's internal date for that message. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@755 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 15 +++++++++++++++ functions/mailbox_display.php | 3 +++ 2 files changed, 18 insertions(+) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 32ab26e..9af572e 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -77,6 +77,21 @@ } } + // If there isn't a date, it takes the internal date and uses + // that as the normal date. + if (trim($date) == "") { + fputs ($imap_stream, "a002 FETCH $id INTERNALDATE\r\n"); + $internal_read = sqimap_read_data ($imap_stream, "a002", true, $r, $m); + + // * 22 FETCH (INTERNALDATE " 8-Sep-2000 13:17:07 -0500") + $date = $internal_read[0]; + $date = eregi_replace(".*internaldate \"", "", $date); + $date = eregi_replace("\".*", "", $date); + $date_ary = explode(" ", trim($date)); + $date_ary[0] = str_replace("-", " ", $date_ary[0]); + $date = implode (" ", $date_ary); + } + $header = new small_header; if ($sent == true) $header->from = $to; diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index e4d3c68..14cf003 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -20,6 +20,9 @@ $senderName = sqimap_find_displayable_name($msg["FROM"]); $urlMailbox = urlencode($mailbox); $subject = trim($msg["SUBJECT"]); + if ($subject == "") + $subject = _("(no subject)"); + echo "\n"; if ($msg["FLAG_FLAGGED"] == true) { $flag = ""; $flag_end = ""; } -- 1.9.1