#1548 Dec 31 1969 Date for msgs with valid dates

closed-fixed
5
2004-02-28
2004-02-05
Anonymous
No

I've been using squirrelmail for the last couple of
years and I really like it.

I'm building a gentoo box for my company as a dedicated
mail server and have installed:

apache 2.0.48
php 4.3.4
uw imap 2002e
exim 4.21
squirrelmail 1.4.2

When I send a message from squirrelmail from and to
local addresses, squirrelmail fails to parse the
headers correctly and ends up displaying incorrect dates.

Bug #1:
If any message fails to parse a date in
imap_messages.php: sqimap_get_small_header_list, the
date will come up 1969 because date is set to "" at
line 512, but then is tested below with isset (it
always passes). I changed it to look like this:

$cc = $to = $type[0] = $inrepto = '';
// tfiner: isset is used below for both of these
unset( $date );
unset ( $type[1] );

This fixes that bug - no longer will 1969 be displayed,
because the unset condition will be caught.

Bug #2
The headers that confuse squirrelmail don't have any
returns "\r" in them, only newlines "\n".

So instead of parsing on "\r\n", I changed it to eat up
all returns and tabs, but then parse on "\n":

line 604:
// $hdr = trim(str_replace(array("\r\n\t", "\r\n
"),array('', ''), $header));
// tfiner: eat up all returns and tabs, leaving newline
as a delimeter
$hdr = trim(str_replace(array('\r', '\t'),array('',
''), $header));

line 611:
//$hdr = explode("\r\n" , $hdr);
$hdr = explode("\n" , $hdr);

Discussion

    • assigned_to: nobody --> kink
     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=285765

    Thanks, fixed.