[dev] Imap client and TLS

Michael M Slusarz slusarz at horde.org
Wed Feb 23 18:33:01 UTC 2011


Quoting Michael Rubinsky <mrubinsk at horde.org>:

> Now I'm getting problems viewing messages in the non-dynamic mode.  
> Attempting to view any message gives a message not found error. This  
> may very well be an older issue unrelated to this. I logged into  
> traditional mode unintentionally after I cleared cookies:

[snip]

> (1298484424.7949) C: 5 EXAMINE ""
> (1298484424.8330) S: 5 NO Empty mailbox name.

Almost 100% sure this has to do with the new IMP_Mailbox code -  
somewhere, the mailbox name is resolving to empty.

Yup... IMP_Indices was not handling conversion from an  
IMP_Mailbox_List_Track object.  Fixed.

Side note: turns out that PHP will not cast an object to string when  
using as an array key.  E.g.:

class Foo {
     public function __toString() { return 'A'; }
}

$a = new Foo();
$b = array($a => 1);

Results in "Illegal offset type" error.  IMHO, if PHP is restricting  
array keys to string/integers, it should automatically cast objects to  
a string.  (Maybe it is worth a shot to request this).  It doesn't, so  
you have to remember to specifically do this:

$b = array(strval($a) => 1);

This is the one place where there is a bit of a hack to make  
IMP_Mailbox objects work properly (since we often store the mailbox  
name as a key in array representations).  Everywhere else you can  
simple use the IMP_Mailbox object where we normally use a string and  
it works as expected.

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]




More information about the dev mailing list