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

Michael M Slusarz slusarz at horde.org
Sun Jan 20 00:52:02 UTC 2013


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

> Quoting Michael M Slusarz <slusarz at horde.org>:
>
> <snip>
>
>>> What is the current/correct way of catching when the requested  
>>> email no longer exists on the IMAP server?
>>
>> $results[160571]->isDefault() !== true
>
> This is not working for me. E.g.;

It is quite possible isDefault() may not work as expected in your use  
case (cached results from fetch()), since we are always storing  
UID/sequence numbers when we create.

Either use SEARCH to check for existence of the message, or explicitly  
check for the existence of a given fetch return field that MUST be  
present (e.g. if a server returns busted structure data, it doesn't  
matter whether the message exists or not because you still won't be  
able to display the message) using  
Horde_Imap_Client_Data_Fetch::exists().

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list