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

Michael M Slusarz slusarz at horde.org
Sun Jan 20 01:03:52 UTC 2013


Quoting Michael M Slusarz <slusarz at horde.org>:

> 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().

An enhancement request to allow fetch() results to be guaranteed to  
exist server-side would be considered.

Right now, if not caching or fetching using message sequence numbers,  
fetch results are guaranteed.  It's just the case of when we are  
caching and given UIDs - which is probably the most common operation -  
that we don't double check (the assumption being the consumer wouldn't  
request a UID unless they have reason to believe it exists).

This "check" would require a specific UID SEARCH UID call to verify  
any list of UIDs provided, so it is an overhead of another IMAP call.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list