[dev] messages not marked as 'personal'

Dominik Gehl dgehl at inverse.ca
Wed Oct 26 09:54:30 PDT 2005


If a user decides to change it's 'from: address' to 
username <user at example.com>
instead of simply 
user at example.com
no messages are marked any more as 'personal' in mailbox.php and
message.php.

This problem could be solved by changing in imp/lib/Identity/imp.php the
getMatchingIdentity and hasAddress functions.

in getMatchingIdentity, instead of 
            /* Next, search all from addresses. */
            if (isset($own_addresses[$find_address])) {
                return $own_addresses[$find_address];
            }
we could use
            foreach (array_keys($own_addresses) as $current_address) {
                if (IMP::bareAddress($current_address) == $find_address)
{
                    return true;
                }
            }

and in hasAddress($address), instead of
//        return isset($list[$address]);
we could use
        foreach (array_keys($list) as $current_address) {
           if (IMP::bareAddress($current_address) == $address) {
                return true;
           }
        }
        return false;

Dominik




More information about the dev mailing list