#98 sorting by 'FROM' field is bad

closed-fixed
None
5
2005-02-03
2005-02-03
Geby
No

function get_squirrel_sort inside imap_messages.php
have a bug.

Part of your sort routine is:

case 'FROM':
case 'TO':
case 'CC':
if(!$walk) {
array_walk($msgs, create_function('&$v,&$k,$f',
'$v[$f] = (isset($v[$f])) ? $v[$f] : "";
$addr =
reset(parseRFC822Address($v[$f],1));
$sPersonal =
(isset($addr[SQM_ADDR_PERSONAL]) &&
$addr[SQM_ADDR_PERSONAL]) ?
$addr[SQM_ADDR_PERSONAL] : "";
$sEmail = ($addr[SQM_ADDR_HOST]) ?
$addr[SQM_ADDR_HOST] .
"@".$addr[SQM_ADDR_HOST] :
$addr[SQM_ADDR_HOST];
$v[$f] = ($sPersonal) ?
decodeHeader($sPersonal):$sEmail;'),$sSortField);
$walk = true;
}

But correct source will be:

case 'FROM':
case 'TO':
case 'CC':
if(!$walk) {
array_walk($msgs, create_function('&$v,&$k,$f',
'$v[$f] = (isset($v[$f])) ? $v[$f] : "";
$addr =
reset(parseRFC822Address($v[$f],1));
$sPersonal =
(isset($addr[SQM_ADDR_PERSONAL]) &&
$addr[SQM_ADDR_PERSONAL]) ?
$addr[SQM_ADDR_PERSONAL] : "";
$sEmail = ($addr[SQM_ADDR_HOST]) ?
$addr[SQM_ADDR_MAILBOX] .
"@".$addr[SQM_ADDR_HOST] :
$addr[SQM_ADDR_HOST];
$v[$f] = ($sPersonal) ?
decodeHeader($sPersonal):$sEmail;'),$sSortField);
$walk = true;
}

Your old routine constructing e-mail address as
HOST@HOST... right will be MAILBOX@HOST

Discussion

  • Tomas Kuliavas

    Tomas Kuliavas - 2005-02-03

    Logged In: YES
    user_id=225877

    issue is specific to 1.5cvs.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-02-03
    • assigned_to: nobody --> stekkel
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-02-03
    • status: open --> closed
     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-02-03

    Logged In: YES
    user_id=225877

    issue should be fixed in functions/imap_messages.php v.1.183

    Thanks for report.

     
  • Tomas Kuliavas

    Tomas Kuliavas - 2005-02-03
    • status: closed --> closed-fixed
     

Log in to post a comment.