[dev] Question with Horde_Imap_Client_Base::fetch() when UID no longer exists.

Michael M Slusarz slusarz at horde.org
Sat Jan 19 23:35:04 UTC 2013


Quoting Michael J Rubinsky <mrubinsk at horde.org>:

> What is the expected behavior when attempting to fetch a UID that no  
> longer exists on the server? I would have thought - and I am almost  
> positive that this is the way it worked when I first coded the AS  
> email code, that there would be no data returned.

Yes, this was the behavior a long time ago.

> Previously, $results[160571] was empty if it didn't exist on the  
> server, now it seems to contain an Horde_Imap_Client_Data_Fetch  
> object:

This is all intentional.  There are a variety of reasons why this is  
the case - none of which are important to review for the current  
discussion.

> var_dump($results[160571]->getStructure()->contentTypeMap());
>
> Results:
> array(1) {
>   [""]=>
>   string(24) "application/octet-stream"
> }
>
> What is the current/correct way of catching when the requested email  
> no longer exists on the IMAP server?

$results[160571]->isDefault() !== true

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list