[dev] Question with Horde_Imap_Client_Base::fetch() when UID no longer exists.
Michael M Slusarz
slusarz at horde.org
Sun Jan 20 00:45:58 UTC 2013
Quoting Michael J Rubinsky <mrubinsk at horde.org>:
> Did this change after H5 was released?
It's been this way for a long while:
commit a9fc8c371ff14e6cd3b0bc3904657f7228991976
Author: Michael M Slusarz <slusarz at horde.org>
Date: Thu May 24 00:11:35 2012 -0600
Fetch results now returned in Horde_Imap_Client_Fetch_Results object
This was well before 2.0.0alpha1 was ever released.
> If so, wouldn't this be a BC break since code that relied on the
> older way of checking for this no longer works?
Even if it switched, it wouldn't be a BC break because the old method
*never* guaranteed that all UIDs provided via the command line would
be returned, whether they exist or not. The API:
* @return array An array of fetch results. The array consists of
* keys that correspond to 'ids', and values that
* contain Horde_Imap_Query_Data_Fetch objects.
Nothing in there about whether any of the 'ids' requested actually
exist. (It used to be possible that you would potentially receive MORE
results than were asked for, based on the way we cached things, and
that is perfectly acceptable).
Regardless... FETCH should never be used for determining whether a
message exists, since an IMAP server can return UID FETCH results for
a message that doesn't exist (some do). Only SEARCH results give
canonical results as to the current state of the mailbox.
michael
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the dev
mailing list