From 0238b4fdd1a64d4132d2bc656dd05f57552708e6 Mon Sep 17 00:00:00 2001 From: ullgren Date: Wed, 22 May 2002 19:59:30 +0000 Subject: [PATCH] Fix for badly formated date string from INTERNALDATE when using courier git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2851 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 69360206..39e0a7ed 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -420,8 +420,21 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $issent) { if ($read_part{0} == '*') { if ($internaldate) { if (preg_match ("/^.+INTERNALDATE\s+\"(.+)\".+/iUA",$read_part, $reg)) { - $date = $reg[1]; - } + if ($imap_server_type == 'courier') { + /** If we use courier, + * We need to reformat the INTERNALDATE-string + **/ + $tmpdate = trim($reg[1]); + $tmpdate = str_replace(' ',' ',$tmpdate); + $tmpdate = explode(' ',$tmpdate); + $date = str_replace('-',' ',$tmpdate[0]) . " " . + $tmpdate[1] . " " . + $tmpdate[2]; + } + else { + $date = $reg[1]; + } + } } if (preg_match ("/^.+RFC822.SIZE\s+(\d+).+/iA",$read_part, $reg)) { $size = $reg[1]; -- 2.25.1