package.xml0000644000175000007640000026650112267677064013222 0ustar slusarzslusarz Horde_Imap_Client pear.horde.org Horde IMAP Client Interface to access IMAP4rev1 (RFC 3501) mail servers. Also supports connections to POP3 (STD 53/RFC 1939). Michael Slusarz slusarz slusarz@horde.org yes 2014-01-22 2.17.1 2.17.0 stable stable LGPL-2.1 * [mms] Fix updating message list in the hashtable cache driver when deleting. 5.3.0 1.7.0 Horde_Exception pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Mail pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Mime pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Socket_Client pear.horde.org 1.1.0 2.0.0alpha1 2.0.0alpha1 Horde_Stream pear.horde.org 1.0.0 2.0.0alpha1 2.0.0alpha1 Horde_Secret pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Stream_Filter pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Translation pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Util pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 hash json Horde_Cache pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Compress_Fast pear.horde.org 1.0.0 2.0.0alpha1 2.0.0alpha1 Horde_Db pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_HashTable pear.horde.org 1.0.0 2.0.0alpha1 2.0.0alpha1 Horde_Mongo pear.horde.org 1.0.0 2.0.0alpha1 2.0.0alpha1 Horde_Pack pear.horde.org 1.0.0 2.0.0alpha1 2.0.0alpha1 Horde_Test pear.horde.org 2.1.0 3.0.0alpha1 3.0.0alpha1 mbstring 1.0.0alpha1 1.0.0 alpha alpha 2011-03-08 LGPL-2.1 * [mms] Add PHPUnit test framework. * [mms] Added constants for RFC-defined flags. * [mms] Supported finalized SPECIAL-USE capability (RFC 6154). * [mms] Add Horde_Imap_Client_Data_AclNegative object. * [mms] Add Horde_Imap_Client_Base#allAclRights(). * [mms] Add Horde_Imap_Client_Data_Acl and Horde_Imap_Client_Data_AclRights objects. * [mms] Horde_Imap_Client_Base#getNamespaces() now returns integer constants for the 'type' parameter. * [mms] Add Horde_Imap_Client_Data_Fetch data object. * [mms] Add Horde_Imap_Client_Ids data object. * [mms] Add Horde_Imap_Client_Fetch_Query data object. * [mms] Add Horde_Imap_Client_Data_Envelope data object. 1.0.0beta1 1.0.0 beta beta 2011-03-16 LGPL-2.1 * [mms] Fix client-side sorting using envelope data. * [mms] Workaround PHP < 5.2.6 (broken stream handling) (Bug #9644). * [mms] Add basic UTF7-IMAP conversion unit test. 1.0.0RC1 1.0.0 beta beta 2011-03-22 LGPL-2.1 * First release candidate for Horde 4. * [mms] Use UIDPLUS results to copy cached data to new mailbox when copying messags. * [mms] Fix fetching by sequence number when caching. 1.0.0RC2 1.0.0 beta beta 2011-03-29 LGPL-2.1 * Second release candidate for Horde 4. * [mms] Provide way to indicate mailboxes that should not have FETCH data cached. 1.0.0 1.0.0 stable stable 2011-04-06 LGPL-2.1 * First stable release for Horde 4. * [mms] Fixes for IMAP servers that support CONDSTORE but disable MODSEQs in mialboxes (Bug #9796). * [mms] Fix obtaining fetch results when searching by sequence number and using caching. * [mms] Add ability to sort mailboxes return from Horde_Imap_Client_Base#statusMultiple(). 1.0.1 1.0.0 stable stable 2011-04-20 LGPL-2.1 * [mms] Work around broken IMAP servers that send EXISTS data in EXPUNGE response (Bug #9915). * [mms] Work around broken ESEARCH on Cyrus (Bug #9842). * [mms] Parse broken date strings that contain timezone information in parantheses (Request #9847). * [mms] Fix for IMAP servers that report MODSEQ information even though CONDSTORE has not been enabled (Bug #9845). * [mms] Fix server-side sorting of subjects in Socket driver (Bug #9840). * [mms] Fix UIDVALIDITY determination for POP3 servers that support UIDL. * [mms] Added Horde_Imap_Client_Data_Fetch_Pop3 object. 1.0.2 1.0.0 stable stable 2011-04-21 LGPL-2.1 * [mms] Correct fix for Bug #9915 (Bug #9943). 1.0.3 1.0.0 stable stable 2011-04-21 LGPL-2.1 * [mms] Return cloned objects from Data results, to prevent issues when caching (Bug #9931). * [mms] Optimize listing subscribed mailboxes for certain queries. * [mms] Add support for PARTIAL search/sort results return (RFC 5267 [4.4]). * [mms] Add support for SEARCH=FUZZY (RFC 6203). 1.0.4 1.0.0 stable stable 2011-04-29 LGPL-2.1 * [mms] Filter CAPABILITY return if sent in response code (Bug #9976). * [mms] Correctly limit FETCH results when specifying changedsince or vanished options and all requested fetch data is already cached. * [mms] Fix intermittent issues retrieving FETCH results in Socket driver. * [mms] Optimize expunging in Socket driver with UIDPLUS servers. * [mms] Fix parsing NAMESPACE response in Socket driver (Bug #9970). 1.0.5 1.0.0 stable stable 2011-05-11 LGPL-2.1 * [mms] Fix OVERQUOTA Exception error constant (Bug #10068; Felipe Zipitría <fzipi@fing.edu.uy>). * [mms] Correctly return PERMANENTFLAGS information if missing in server return. * [mms] Optimizing expunging when using QRESYNC. * [mms] Optimize re-opening a mailbox R/W if using CONDSTORE/QRESYNC. * [mms] Optimize statusMultiple() for currently selected mailbox. * [mms] Optimize search()/thread() in empty mailboxes. 1.0.6 1.0.0 stable stable 2011-05-25 LGPL-2.1 * [mms] Fix changedsince FETCH results when no cacheable fields were present in query. * [mms] Fix/optimize updating Sequence -> UID list when processing EXPUNGEs (Bug #10097). * [mms] Fix UTF-8 -> UTF7-IMAP encoding of ampersands (Bug #10093). * [mms] Fix setACL() for Socket driver (was always doing replace instead of add/remove). * [mms] Fix ACL parsing on RFC 2086 server implementations (Bug #10079). * [mms] More than one SEARCH response may be sent, so don't overwrite existing values. * [mms] Disable search caching if a mailbox reports it does not support mod sequences (Bug #9833). * [mms] Fix storing IMAP flag cache info if specifying both add and remove options to store(). 1.0.7 1.0.0 stable stable 2011-06-01 LGPL-2.1 * [mms] Support response code for POP3 servers (RFC 2449/3206). * [mms] Enable cache support for POP3 Socket driver (FETCH data only). * [mms] Fix APOP authentication for POP3 Socket driver. * [mms] Fix regression with UTF7-IMAP encoding of non-ascii folder names (Bug #10093). 1.0.8 1.0.0 stable stable 2011-06-14 LGPL-2.1 * [mms] Fix re-subscribing to child mailboxes of a renamed mailbox (Bug #10212). * [mms] Fix base subject generation under RFC 5256 [2.1]. 1.0.9 1.0.0 stable stable 2011-07-05 LGPL-2.1 * [jan] Fix stripping attachments from mailboxes with non-ascii names. * [mjr] Fix incorrect method name in Pop3 Socket driver. 1.0.10 1.0.0 stable stable 2011-08-03 LGPL-2.1 * [mms] Fix OR search if first search element contains more than one search criteria (Bug #10404). * [mms] Fix invalid IMAP command being sent if a changedsince search was empty. 1.0.11 1.0.0 stable stable 2011-08-09 LGPL-2.1 * [mms] Fix regression in POP3 Socket driver that caused incorrect parsing of server data (Bug #10417). 1.0.12 1.0.0 stable stable 2011-08-17 LGPL-2.1 * [mms] Fix typo that prevented deletion of messages on POP3 servers (Bug #10424). 1.0.13 1.0.0 stable stable 2011-08-23 LGPL-2.1 * [mms] Fix rare race condition that may cause FETCH requests in the IMAP Socket driver to return empty results (Bug #10434). 1.0.14 1.0.0 stable stable 2011-08-30 LGPL-2.1 * [mms] Add support for CRAM-SHA1 and CRAM-SHA256 authentication (available in Courier SASL library). * [mms] Remove dependency on Auth_SASL for CRAM-MD5 authentication. * [mms] Ignore unknown authentication methods; otherwise, they give false positive when authenticating (Bug #10453). 1.0.15 1.0.0 stable stable 2011-08-31 LGPL-2.1 * [mms] Remove dependency on Auth_SASL. 1.1.0 1.1.0 stable stable 2011-10-08 LGPL-2.1 * [mms] Fix client-side Cc/From/To sorting (Bug #10503). * [mms] Improved IMAP debug logging. * [mms] Fix search charset determination for servers that support SORT & ESORT (Bug #10479). * [mms] Improved phpdoc documentation. * [mms] API CHANGE: Add shortcuts to get MIME decoded envelope information. * [mms] Automatically authenticate to server when using a command that requires an authenticated/selected state (Bug #10473). 1.2.0 1.2.0 stable stable 2011-11-04 LGPL-2.1 * [mms] Fixed setting data for several POP3 fetch results. * [mms] Parsing/generating sequence strings for POP3 servers has been fixed. * [mms] Removed unmaintained Mock driver. * [mms] API CHANGE: Added Horde_Imap_Client_Mailbox to provide way to accurately switch between UTF7-IMAP and UTF-8 mailbox representations. * [mms] API CHANGE: Deprecate Horde_Imap_Client_Base::parseCommandArray() - use Horde_Imap_Client_Utils::parseCommandArray() instead. * [mms] API CHANGE: Added a required parameter ('baseob') to Horde_Imap_Client_Cache constructor. * [mms] API CHANGE: Added Horde_Imap_Client_Base::writeDebug(). * [mms] API CHANGE: Added Horde_Imap_Client_Base::getIdsOb(). * [mms] API CHANGE: Deprecate Horde_Imap_Client_Cache::singleton(). 1.2.1 1.2.0 stable stable 2011-11-22 LGPL-2.1 * [mms] Workaround missing search charset support in the Socket driver (Bug #10726). * [mms] Only add CHARSET data to SEARCH queries if necessary (Bug #10726). * [mms] Fix deletion of cached message entries. 1.3.0 1.2.0 stable stable 2011-12-13 LGPL-2.1 * [mms] Work around broken headers in IMAP envelope data. * [mms] Remove Cclient drivers. 1.3.1 1.2.0 stable stable 2011-12-21 LGPL-2.1 * [mms] LIST-STATUS does not depend on LIST-EXTENDED. * [mms] Add dependency checking for capabilities. 1.3.2 1.2.0 stable stable 2012-01-17 LGPL-2.1 * [mms] Allow multiple date searches to be specified in a single AND search query. * [mms] Fix deleting cached mailbox when mailbox name is given as an object. * [mms] Fix 'changedsince' and 'vanished' parameters' in the fetch() command (Bug #10915). 1.4.0 1.4.0 stable stable 2012-01-31 LGPL-2.1 * [jan] Add German translation. * [jan] Add Spanish translation (Manuel P. Ayala <mayala@unex.es>). * [mms] Implement more efficient serialization for Thread data objects. * [mms] Move server debug information from exception error message to 'details' property of exception object. * [mms] Fix METADATA_TOOMANY and METADATA_NOPRIVATE exception codes. * [mms] All user-directed exception messages are now translated. * [mms] Added Horde_Imap_Client_Exception_NoSupportExtension. * [mms] Incorrect method calls now throw SPL errors instead of Horde_Imap_Client_Exceptions. 1.4.1 1.4.0 stable stable 2012-01-31 LGPL-2.1 * [jan] Fix translations when installed through PEAR. 1.4.2 1.4.0 stable stable 2012-02-01 LGPL-2.1 * [mms] Fix objects where the password is not being encrypted (Bug #10950). 1.4.3 1.4.0 stable stable 2012-02-06 LGPL-2.1 * [mms] Workaround non-ASCII data in bodystructure return from IMAP server. * [mms] Fix several faulty translation strings (Bug #10958). 1.4.4 1.4.0 stable stable 2012-02-12 LGPL-2.1 * [mms] Re-release of 1.4.3 due to broken PEAR .tgz package. 1.5.0 1.5.0 stable stable 2012-02-22 LGPL-2.1 * [mms] Add Horde_Imap_Client_Base#setParam() (Bug #10680). * [mms] Return correct authentication error if authentication fails after the original login (Bug #11007). * [mms] Do case-insensitive check for NIL in IMAP data. * [mms] Correctly support RFC 822 groups in envelope data. * [mms] Envelope address data now returned as Horde_Mail_Rfc822_Address objects. * [mms] Other places where bodystructure may return literals. 1.5.1 1.5.0 stable stable 2012-02-28 LGPL-2.1 * [mms] Workaround PHP bug when using serialized Envelope data created by Horde_Imap_Client < 1.5.0 (Bug #11026). * [mms] Fix accessing STATUS information for mailboxes with non 7-bit characters. * [mms] Fix 'vanished' return from fetch(). 1.5.2 1.5.0 stable stable 2012-04-09 LGPL-2.1 * [mms] Fix CHANGEDSINCE search if no FETCH attributes were specified (Bug #11132). * [mms] Fix search charset detection for servers that do not send the BADCHARSET response code (Bug #11117). * [mms] Workaround IMAP servers with broken CATENATE implementations (Bug #11111). * [jan] Fix sending ID requests. * [jan] Add Finnish translation (Leena Heino <liinu@uta.fi>). * [mms] Rewrite of caching system. Fixes a few bugs, and should be more efficient. * [mms] Clear imapproxy status when logging out. 1.5.3 1.5.0 stable stable 2012-04-11 LGPL-2.1 * [mms] Fixed PHP 5.2 incompatibility (Bug #11137). 1.5.4 1.5.0 stable stable 2012-04-12 LGPL-2.1 * [mms] Fix regression in caching code (Bug #11143). 1.5.5 1.5.0 stable stable 2012-06-29 LGPL-2.1 * [mms] Improved handling of multi-accessed mailboxes and the FETCH/STORE/SEARCH commands (RFC 2180 [2-4]). 1.5.6 1.5.0 stable stable 2012-07-28 LGPL-2.1 * [mms] Fix sorting of numeric mailboxes with leading zeros. * [mms] Optimize statusMultiple() when polling mailboxes containing wildcard characters. * [mms] Correctly handle any resource key supported by the QUOTA extension. 1.5.7 1.5.0 stable stable 2012-07-30 LGPL-2.1 * [mms] Fix determining sequence numbers when caching is active (Bug #11294). 1.5.8 1.5.0 stable stable 2012-09-19 LGPL-2.1 * [mms] Fix CRAM-MD5 authentication (Bug #11449; patrickdk@patrickdk.com). * [mms] Allow SSL version to be explicitly chosen via 'secure' configuration option (Request #11435). 1.5.9 1.5.0 stable stable 2012-09-26 LGPL-2.1 * [mms] Fix POP3 regression that broken envelope data parsing (Bug #11477). * [mms] Fix outputting the host part when using Horde_Imap_Client_Utils#createUrl(). * [mms] Fix obtaining UIDs for APPENDed messages when the server doesn't support APPENDUID. 1.5.10 1.5.0 stable stable 2012-10-15 LGPL-2.1 * [mms] Fix reinitializing a prior authenticated client object when the IMAP server subsequently becomes unavailable (Bug #11413). 1.5.11 1.5.0 stable stable LGPL-2.1 * [mms] Fix CRAM-MD5 authentication for POP3 driver (Bug #11449). * [mms] Allow SSL version to be explicitly chosen via 'secure' configuration option for POP3 driver (Request #11435). 2012-07-06 2.0.0alpha1 2.0.0alpha1 alpha alpha LGPL-2.1 * First alpha release for Horde 5. * [mms] Internally workaround IMAP servers that don't support text searches other than US-ASCII. * [mms] Horde_Imap_Client_DateTime is now a wrapper around the native PHP DateTime object (Request #11074). * [mms] Implement new 2.0 API. See UPGRADING for full details of changes. 2.0.0beta1 2.0.0beta1 beta beta 2012-07-19 LGPL-2.1 * First beta release for Horde 5. * [mms] Allow auto-escaping of mailbox names in listMailboxes(). * [mms] Add list_escape property to Horde_Imap_Client_Mailbox. * [mms] Remove public cache variable from IMAP driver. 2.0.0beta2 2.0.0beta1 beta beta 2012-08-07 2.0.0beta3 2.0.0beta1 beta beta 2012-08-29 LGPL-2.1 * [mms] Correctly handle any resource key supported by the QUOTA extension. 2.0.0beta4 2.0.0beta1 beta beta 2012-10-12 LGPL-2.1 * [jan] Add deleteACL(). * [jan] Make setACL() work more similar to the SETACL IMAP command. * [mms] Fix determination of HIGHESTMODSEQ value from FETCH data. * [mms] Store command that caused NO/BAD error in Exception, if it can be determined. * [mms] Limit FETCH ENVELOPE data sizes. * [mms] Improved parsing of incoming IMAP server stream. * [mms] Improved parsing of IMAP threading data. * [mms] Improved IMAP tokenizer of server response data using PHP temporary streams. * [mms] Add standalone IMAP command tokenizer. * [mms] Rewritten handling for processing outgoing IMAP commands. * [mms] Improved debugging efficiency. * [mms] Added data objects for the various IMAP data types. * [mms] Added the Horde_Imap_Client_Data_Format objects. 2.0.0RC1 2.0.0beta1 beta beta 2012-10-26 LGPL-2.1 * [mms] Improved handling of server write errors in the Socket driver. * [mms] Add support for IMAP MOVE command. * [mms] Correctly handle FETCH results intermingled with EXPUNGE/VANISHED requests within a single request. * [mms] Now that we have accurate sequence numbers for our cached values, we can utilize the known UID set parameter to a QRESYNC EXAMINE/SELECT command. * [mms] Correctly handle EXISTS/EXPUNGE/VANISHED untagged responses which may appear at any time. * [mms] Fix handling message sequence number actions returned from server when using CONDSTORE/QRESYNC. * [mms] Fix CONDSTORE synchronization of deleted messages since last mailbox access. * [mms] Need to immediately synchronize mailbox on mailbox load with CONDSTORE or else we may lose flag change information. * [mms] Fixes/improvements to CONDSTORE capability sniffing and enabling. * [mms] Remove statuscache configuration option. * [mms] Optimize generation of POP3 sequence string. * [mms] Abstract forced determination of UIDNEXT value from cache method to a status() flag. * [mms] Remove Horde_Imap_Client_Base#fetchFromSectionString(). * [mms] Horde_Imap_Client_Base#listMailboxes() now supports 'status' return even if server does not server LIST-STATUS. * [mms] Remove Horde_Imap_Client_Base#fetchCacheIgnore(). * [mms] Move IMAP/POP URL parsing to new Horde_Imap_Client_Url object. * [mms] Move base subject parsing to new Horde_Imap_Client_Data_BaseSubject class. * [mms] Move IMAP sequence string generation/parsing to the Horde_Imap_Client_Ids object. * [mms] Remove Horde_Imap_Client_Utils#escape(). * [mms] Remove Horde_Imap_Client_Utils#removeBareNewlines(). * [mms] Move IMAP mailboxes sorting into new Horde_Imap_Client_Mailbox_List class. * [mms] Correctly handle determination of highestmodseq in currently selected mailbox if CONDSTORE, but not QRESYNC, is active. * [mms] Optimize APPEND so that we don't send large amounts of data to server if the server is not going to accept the data. * [mms] Don't expunge mailbox when it is labeled as read-only. * [mms] Fix regression in FETCH/COPY with sequence numbers (Bug #11521). * [mms] Fix quoting empty astrings (Bug #11505). * [jan] Fix Horde_Stream dependency. 2.0.0RC2 2.0.0beta1 beta beta 2012-10-29 LGPL-2.1 * [mms] Fix invalid class name usage (Bug #11586). * [mms] Remove STATUS_LASTMODSEQ and STATUS_LASTMODSEQUIDS return options from status(). 2.0.0 2.0.0 stable stable 2012-10-30 LGPL-2.1 * First stable release for Horde 5. * [mms] Fix regression in Horde_Imap_Client_Base#listMailboxes() return when both the 'flat' and 'sort' options are active. * [mms] Add STATUS_SYNCMODSEQ, STATUS_SYNCFLAGUIDS, and STATUS_SYNCVANISHED return options to Horde_Imap_Client_Base#status(). 2.1.0 2.1.0 stable stable 2012-11-02 LGPL-2.1 * [mms] Split debugging code from Base driver into separate object. * [mms] Fix double encoding of non-ASCII elements in listMailboxes() (Bug #11608). * [mms] Fix regression for non-cached Socket objects (Bug #11605). * [mms] Improved handling of server write errors in the Socket driver. * [mms] Add support for IMAP MOVE command. * [mms] Correctly handle FETCH results intermingled with EXPUNGE/VANISHED requests within a single request. * [mms] Correctly handle EXISTS/EXPUNGE/VANISHED untagged responses which may appear at any time. * [mms] Fix handling message sequence number actions returned from server when using CONDSTORE/QRESYNC. 2.1.1 2.1.0 stable stable 2012-11-03 LGPL-2.1 * [mms] Massive performance increase for cached FETCH queries. 2.1.2 2.1.0 stable stable 2012-11-05 LGPL-2.1 * [mms] Fix parsing empty ACL responses. 2.1.3 2.1.0 stable stable 2012-11-05 LGPL-2.1 * [mms] Allow Horde_Imap_Client_Base#vanished() to work with non-QRESYNC servers if the 'ids' option is given. * [mms] Always map UIDs to sequence numbers if resolving an all UIDs search. * [mms] Ignore empty ID search queries. 2.1.4 2.1.0 stable stable 2012-11-19 LGPL-2.1 * [jan] Add Dutch translation (Arjen de Korte <build+horde@de-korte.org>). * [mms] Fix returning UIDNEXT when using UIDNEXT_FORCE and the server does not automatically return this information. * [mms] Significant optimization to append() command. * [mms] Add abstracted syncing methods to Horde_Imap_Client_Base. 2.1.5 2.1.0 stable stable 2012-11-06 LGPL-2.1 * [mms] Correctly workaround servers that incorrectly implement the LIST-EXTENDED command. 2.1.6 2.1.0 stable stable 2012-11-10 LGPL-2.1 * [mms] Fix parsing PARSE response code associated with an OK response. * [mms] Workaround broken BINARY implementation on UW-IMAP servers. * [mms] If we have binary data, and server doesn't support BINARY extension, send data anyway since we don't have any other option. * [mms] Correctly increment UIDNEXT when an EXISTS response is issued after the mailbox is opened (Bug #11679). * [mms] Fix regression that may have caused message flags to have been improperly cached if debugging was disabled (Bug #11665). 2.2.0 2.2.0 stable stable 2012-11-10 LGPL-2.1 * [mms] Fix returning UIDNEXT when using UIDNEXT_FORCE and the server does not automatically return this information. * [mms] Significant optimization to append() command. * [mms] Add abstracted syncing methods to Horde_Imap_Client_Base. 2.2.1 2.2.0 stable stable 2012-11-22 LGPL-2.1 * [mms] Workaround broken BINARY extension on Cyrus servers. 2.2.2 2.2.0 stable stable 2012-11-27 LGPL-2.1 * [mms] Complete workaround for broken BINARY extension on Cyrus servers. 2.2.3 2.2.0 stable stable 2012-11-28 LGPL-2.1 * [mms] Another workaround for broken Cyrus APPEND behavior (Bug #11769). 2.3.0 2.3.0 stable stable 2012-12-03 LGPL-2.1 * [mms] Fix sending literal mailbox data to an IMAP server (Bug #11800). * [mms] Add Horde_Imap_Client_Data_Format_String#getStream(). * [jan] Fix Dutch translation (Arjen de Korte <build+horde@de-korte.org>). * [mms] Fix regression in POP3 driver for servers that don't support the RESP-CODES extension. 2.3.1 2.3.0 stable stable 2012-12-05 LGPL-2.1 * [mms] Fix client-side address sorting (Bug #11820). * [mms] Optimizations to IMAP token parser. * [mms] Fix setting language value when language is returned in an IMAP list. 2.3.2 2.3.0 stable stable 2012-12-06 LGPL-2.1 * [mms] Revert valid PHP changes that caused errors in broken old versions of PHP. 2.4.0 2.4.0 stable stable 2012-12-17 LGPL-2.1 * [mms] Re-add optimizations to IMAP token parser. * [jan] Add Basque translation (Ibon Igartua <ibon.igartua@ehu.es>). * [mms] Additional workarounds for IMAP servers with broken BINARY implementations (Bug #11855). * [mms] Add SORT_DISPLAYFROM_FALLBACK and SORT_DISPLAYTO_FALLBACK sorting criteria to Horde_Imap_Client_Base#search(). 2.4.1 2.4.0 stable stable 2012-12-20 LGPL-2.1 * [mms] Fix bodystructure parsing for IMAP servers that do not return full extension data (Bug #11907). 2.4.2 2.4.0 stable stable 2013-01-04 LGPL-2.1 * [mms] Fix multipart APPENDs when IMAP server does not support CATENATE. * [mms] Fix harmless PHP warning issued when IMAP server supports SORT but not SORT=DISPLAY. 2.5.0 2.5.0 stable stable 2013-01-22 LGPL-2.1 * [mms] Some IMAP servers require a mailbox to be unselected before it can be renamed. * [jan] Add French translation (Paul De Vlieger <paul.de_vlieger@moniut.univ-bpclermont.fr>). * [mms] Ignore fetch data returned from an UID FETCH command if it doesn't include UID information (Bug #11946). * [mms] Add exists option to Horde_Imap_Client_Base#fetch(). 2.6.0 2.6.0 stable stable 2013-02-08 LGPL-2.1 * [mms] Fix regression in parsing LISTRIGHTS results (Bug #11994). * [mms] Workaround QRESYNC errata that allows FETCH FLAGS results to be returned without UID information. * [mms] More robust handling of split FETCH responses. 2.7.0 2.7.0 stable stable 2013-02-24 LGPL-2.1 * [mms] More efficient implementation of Horde_Imap_Client_Ids#range_string. * [mms] Fix APPENDs on IMAP servers that do not support CATENATE. * [mms] Fix from/to searches on servers that support SORT=DISPLAY when using the *_FALLBACK sort criteria. * [mms] Ensure that a FETCH and/or SELECT/EXAMINE (w/QRESYNC) will not exceed maximum allowed command length on the IMAP server (Bug #12001). * [mms] Add Horde_Imap_Client_ids#split(). * [mms] Fix regression in the replace argument, and multiple arguments to add/delete, for the store() command. * [mms] Make sure the modseq given to the vanished() command is always at least 1 (Bug #12031). 2.7.1 2.7.0 stable stable 2013-03-04 LGPL-2.1 * [mms] Fix SETQUOTA, GETQUOTA, and GETQUOTAROOT commands on mailboxes that contain non-7bit characters (Bug #12059). * [mms] Fix returning UID data from the Horde_Imap_Client_Data_Sync object (Bug #12071). 2.7.2 2.7.0 stable stable 2013-03-08 LGPL-2.1 * [mms] Always return UID information for FETCH queries if cache is active, so we ensure that mappings are updated and any cacheable data can be cached. * [mms] Don't cache FETCH data if it does not contain UID information (Bug #12097). 2.8.0 2.8.0 stable stable 2013-03-26 LGPL-2.1 * [mms] Add properties to Sync object to allow retrieval of previous sync state status. * [mms] Only do UNCHANGEDSINCE check when storing flags if the user explicitly passes the 'unchangedsince' parameter. * [mms] Add the 'nocache' option to Horde_Imap_Client_Base#fetch(). 2.8.1 2.8.0 stable stable 2013-03-28 LGPL-2.1 * [mms] Fix regression in storing cached flags if not using debug mode. 2.8.2 2.8.0 stable stable 2013-04-18 LGPL-2.1 * [mms] Correctly parse message/rfc822 BODYSTRUCTURE responses if the server does not provide any envelope information (Bug #12190). 2.9.0 2.9.0 stable stable 2013-05-01 LGPL-2.1 * [mms] Support UID EXPUNGE command for large UID lists (Bug #12228). * [mms] Don't attempt to expunge messages if the list of UIDs to expunge is empty (Bug #12226). * [mms] Correctly use limit parameter to Horde_Imap_Client_Ids#split() (Bug #12216). * [mms] Add a MongoDB based backend for storing cached IMAP/POP data. * [mms] Add Horde_Imap_Client_Cache#clear(). * [mms] Add a Horde_Db based backend for storing cached IMAP/POP data. * [mms] Abstract the backend storage into a separate driver for the Horde_Imap_Client_Cache class. 2.9.1 2.9.0 stable stable 2013-05-14 LGPL-2.1 * [jan] Fix dependency. 2.10.0 2.10.0 stable stable 2013-05-17 LGPL-2.1 * [mms] Pipeline multiple IMAP LIST/LSUB calls. * [mms] Fix login methods that require server continutation responses. * [mms] Correctly handle enabled cached status when not using imapproxy. * [mms] Fix caching of CAPABILITY information when not using imapproxy. * [mms] Support pipelining of STORE + EXPUNGE if UIDPLUS is available. * [mms] Pipeline multiple STATUS commands if LIST-STATUS is not available. * [mms] Fold statusMultiple() functionality into base status() command. * [mms] Pipeline multiple IMAP FETCH calls. * [mms] Delay sending LANGUAGE command until we send another command to save a round-trip. * [mms] Delay sending ENABLE command until we send another command to save a round-trip. * [mms] Add internal support for IMAP command pipelining. 2.10.1 2.10.0 stable stable 2013-05-21 LGPL-2.1 * [mms] Fix returning the list of deleted messages in the POP3 driver. * [mms] Handle all additional namespace queries in a single call. 2.11.0 2.11.0 stable stable 2013-05-27 LGPL-2.1 * [mms] Workaround broken IMAP servers and prevent infinite loops (Bug #12265). * [mms] Add support for the DOWNGRADED IMAP response code (RFC 6858). 2.11.1 2.11.0 stable stable 2013-05-28 LGPL-2.1 * [mms] Fix caching MIME structure data in POP3 driver. * [mms] Enhanced parsing of POP3 data from the remote server. 2.11.2 2.11.0 stable stable 2013-05-28 LGPL-2.1 * [mms] Fix regression in Socket driver when moving messages without UIDPLUS. 2.11.3 2.11.0 stable stable 2013-06-03 LGPL-2.1 * [mms] Improved detection of client-side command errors before sending to the remote IMAP server. * [mms] Better sanity checking that we don't send binary data for mailbox entries. 2.11.4 2.11.0 stable stable 2013-06-04 LGPL-2.1 * [mms] Be more lenient about mailboxes containing null characters in Horde_Imap_Client 2.x for BC reasons. * [mms] Fix flushing debug buffer when unexpected data is returned from the remote server. 2.11.5 2.11.0 stable stable 2013-06-11 LGPL-2.1 * [mms] So many IMAP servers have issues with BINARY, that we should not send literal8 data unless we absolutely have to. * [mms] Remove read/write buffering from stream connection to remote server. * [mms] Ensure we only use literal8's in APPEND commands. * [mms] Abstract connection code into separate library, to better handle output buffering and error handling. * [mms] Fix regression in throwing exceptions when parsing POP3 server responses. 2.11.6 2.11.0 stable stable 2013-06-18 LGPL-2.1 * [mms] Fix regression in handling response codes in POP3 driver. * [mms] Fix clearing data from the MongoDB cache. 2.12.0 2.12.0 stable stable 2013-07-24 LGPL-2.1 * [mms] Added the Horde_Imap_Client::STATUS_RECENT_TOTAL return option to Horde_Imap_Client_Base#status(). * [mms] More graceful handling of servers that return broken FETCH information (Request #12441). 2.12.1 2.12.0 stable stable 2013-08-13 LGPL-2.1 * [mms] Fix returning list of expunged UIDs when expunging all messages in a mailbox that doesn't support CONDSTORE (Bug #12559). * [mms] Translate mailbox names from UTF7-IMAP -> UTF-8 in return from Horde_Imap_Client_Base#getMetadata() (Bug #12541). 2.12.2 2.12.0 stable stable 2013-08-15 LGPL-2.1 * [mms] Add remote POP3 server test. * [mms] Fix sniffing capabilities for POP3 servers that don't support the CAPA command. 2.12.3 2.12.0 stable stable 2013-08-16 LGPL-2.1 * [mms] Fix regression in caching for POP3 servers. * [mms] Cache any data returned from POP3 capability sniffing. 2.13.0 2.13.0 stable stable 2013-08-19 LGPL-2.1 * [mms] Fix regression in POP3 SASL PLAIN authentication command. * [mms] Fix regression in mapping message sequence numbers to UIDs when doing an 'all' activity in POP3. * [mms] Added support for the Google XOAUTH2 authentication mechanism for the IMAP Socket driver. * [mms] Fix regression in retrieving CAPABILITY information after we login. 2.13.1 2.13.0 stable stable 2013-08-20 LGPL-2.1 * [mms] Fix regression in setting CAPABILITY for IMAP servers that don't automatically send this information after login. 2.14.0 2.14.0 stable stable 2013-08-25 LGPL-2.1 * [mms] Added the 'statuscache' property to Horde_Imap_Client_Base (Request #12589). * [mms] The 'xoauth2_token' parameter now accepts a Horde_Imap_Client_Base_Password object. * [mms] Deprecated the 'encryptKey' parameter and instead support passing a Horde_Imap_Client_Base_Password object into the 'password' parameter. * [mms] Added the Horde_Imap_Client::STATUS_FORCE_REFRESH flag. 2.15.0 2.15.0 stable stable 2013-09-03 LGPL-2.1 * [mms] Workaround servers that don't advertise UIDL until after authentication. * [mms] Fix parsing continuation requests sent in SASL AUTH command (RFC 5034). * [mms] By default, use TLS if available and necessary to login to server. * [mms] Fix adding status information to listMailboxes() return when LIST-STATUS is not available. 2.15.1 2.15.0 stable stable 2013-09-13 LGPL-2.1 * [mms] Ensure Horde_Imap_Client_Base#search() always returns the 'count' value (Bug #12682). * [jan] Fix incorrect usage of Horde_Db API in cache backend. 2.15.2 2.15.0 stable stable 2013-09-14 LGPL-2.1 * [mms] Handle case-insensitive INBOX return from the server. * [mms] Use strict RFC-compliant workaround for servers that don't support the UNSELECT IMAP extension. 2.15.3 2.15.0 stable stable 2013-09-16 LGPL-2.1 * [mms] Fix regression where INBOX may not be recognized as subscribed, if the server doesn't list it in the subscribed list. 2.15.4 2.15.0 stable stable 2013-10-09 LGPL-2.1 * [mms] Sort UID list before sending in QRESYNC parameter. * [mms] Ensure that INBOX always appears in subscribed mailbox list when using a server that supports LIST-EXTENDED. 2.15.5 2.15.0 stable stable 2013-10-11 LGPL-2.1 * [mms] Explicitly reject XOAUTH2 as a authentication mechanism if it is not configured in the client (Bug #12756). 2.16.0 2.16.0 stable stable 2013-10-30 LGPL-2.1 * [mms] Added direct TLS v1.x connection option when connecting to remote server. * [mms] Use SHA-1 instead of MD5 for internal hashing. * [mms] Correctly handle untagged BAD IMAP responses. * [mms] Added Horde_Imap_Client_Password_Xoauth2 class. * [mms] Fix harmless PHP undefined error when using with an IMAP server that supports XOAUTH2. 2.16.1 2.16.0 stable stable 2013-11-21 LGPL-2.1 * [mms] Fix intermittent error when purging messages using a Horde_Cache caching backend (Bug #12827). * [mms] Workaround broken IMAP servers that don't support the required AUTH=PLAIN authentication method (Bug #12817). 2.16.2 2.16.0 stable stable 2013-11-27 LGPL-2.1 * [mms] Don't login to IMAP server if namespace information is already cached. 2.17.0 2.17.0 stable stable 2014-01-17 LGPL-2.1 * [mms] When determining a sequence -> UID mapping, do sanity checking to make ensure data is valid (Bug #12911). * [mms] Add a Horde_Hashtable specific cache driver. * [mms] Add remove() method to Horde_Imap_Client_Ids. 2.17.1 2.17.0 stable stable 2014-01-22 LGPL-2.1 * [mms] Fix updating message list in the hashtable cache driver when deleting. Horde_Imap_Client-2.17.1/doc/Horde/Imap/Client/COPYING0000644000175000007640000005765612267677064022114 0ustar slusarzslusarz GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Horde_Imap_Client-2.17.1/doc/Horde/Imap/Client/UPGRADING0000644000175000007640000005066112267677064022311 0ustar slusarzslusarz============================= Upgrading Horde_Imap_Client ============================= :Contact: dev@lists.horde.org .. contents:: Contents .. section-numbering:: This lists the API changes between releases of the package. Upgrading to 2.17.0 =================== - Horde_Imap_Client_Cache_Backend_Hashtable Added a Hashtable specific caching driver. - Horde_Imap_Client_Ids - remove() This method has been added. Upgrading to 2.16.0 =================== - Horde_Imap_Client_Base - Constructor Added 'tlsv1' option for the 'secure' configuration parameter. - Horde_Imap_Client_Password_Xoauth2 Added class to abstract production of the necessary token for XOAUTH2 SASL authentication. Upgrading to 2.15.0 =================== - Horde_Imap_Client_Base - Constructor Added true as an option for the 'secure' configuration parameter. Upgrading to 2.14.0 =================== - Horde_Imap_Client_Base - Constructor The 'encryptKey' parameter is deprecated. Instead, allow a Horde_Imap_Client_Base_Password object to be passed via the 'password' parameter. - $statuscache This property has been added. - status() Added the Horde_Imap_Client::STATUS_FORCE_REFRESH flag. - Horde_Imap_Client_Socket - Constructor The 'xoauth2_token' parameter now accepts a Horde_Imap_Client_Base_Password object. Upgrading to 2.13.0 =================== - Horde_Imap_Client_Socket - Constructor Added the 'xoauth2_token' parameter. Upgrading to 2.12.0 =================== - Horde_Imap_Client_Base - status() Added the Horde_Imap_Client::STATUS_RECENT_TOTAL return value. Upgrading to 2.11.0 =================== - Horde_Imap_Client_Data_Fetch Added the setDowngraded() and isDowngraded() methods. Upgrading to 2.10.0 =================== - Horde_Imap_Client_Base - expunge() The 'delete' option was added. - status() The $mailbox argument now supports array input (and will return an array of multiple mailboxes). Additionally, the third $options parameter has been added. - statusMultiple() This method has been deprecated. Use status() instead. - Horde_Imap_Client_Interaction_Client This class is deprecated (and no longer used internally). Upgrading to 2.9.0 ================== - Horde_Imap_Client_Base The 'cacheob', 'lifetime', and 'slicesize' parameters to the 'cache' constructor option have been deprecated. Use the 'backend' parameter instead. - Horde_Imap_Client_Cache Added the clear() method. Upgrading to 2.8.0 ================== - Horde_Imap_Client_Base The 'nocache' option was added to fetch(). - Horde_Imap_Client_Data_Sync The following public properties have been added: - $highestmodseq - $map (static value) - $messages - $uidnext - $uidvalidity Upgrading to 2.7.0 ================== - Horde_Imap_Client_Ids The split() method was added. Upgrading to 2.6.0 ================== - Horde_Imap_Client_Fetch_Results The clear() method was added. Upgrading to 2.5.0 ================== - Horde_Imap_Client_Base The 'exists' option was added to fetch(). Upgrading to 2.4.0 ================== - Horde_Imap_Client_Base The following 'sort' criteria have been added to search(): - SORT_DISPLAYFROM_FALLBACK - SORT_DISPLAYTO_FALLBACK Upgrading to 2.3.0 ================== - Horde_Imap_Client_Data_Format_String The following methods have been added: - getStream() Upgrading to 2.2.0 ================== - Horde_Imap_Client_Base The following methods have been added: - getSyncToken() - sync() The following methods have been marked as deprecated and will be removed in 3.0: - getCacheId() - parseCacheId() Upgrading to 2.1.0 ================== The Horde_Imap_Client_Ids_Map class has been added. - Horde_Imap_Client_Cache The following config options have changed: - debug Now requires a Horde_Imap_Client_Base_Debug object. The previous 'true' value will be ignored. Upgrading to 2.0.0 ================== The cclient drivers have been removed. Exception logging has been removed; the calling code is now responsible for logging any errors. - Horde_Imap_Client - factory() The factory method has been removed. The client driver should instead be directly instantiated. - Horde_Imap_Client_Base The following config options have been removed: - statuscache The following properties have changed: - $cache This public member variable has been removed. Obtain the cache object by calling getCache() instead. - $utils This public member variable has been removed. The following methods have changed: - append() The $mailbox parameter can no longer be a UTF7-IMAP string. - copy() The $source and $dest parameters can no longer be UTF7-IMAP strings. - createMailbox() The $mailbox parameter can no longer be a UTF7-IMAP string. - currentMailbox() The 'mailbox' portion of the return value is always returned as a Horde_Imap_Client_Mailbox object. The $options parameter has been removed. - deleteACL() This method has been added. - deleteMailbox() The $mailbox parameter can no longer be a UTF7-IMAP string. - expunge() The $mailbox parameter can no longer be a UTF7-IMAP string. - fetch() The 'fetch_res' option has been removed. The 'vanished' option has been removed - use the vanished() method instead. The $mailbox parameter can no longer be a UTF7-IMAP string. Results are now returned as a Horde_Imap_Client_Fetch_Results object. - fetchCacheIgnore() This method has been removed. Use getParam()/setParam() to change parameter values instead. - fetchFromSectionString() This method has been removed. - getNamespaces() The array keys, 'name' key, and 'translation' key in the return array return UTF-8 strings (not UTF7-IMAP). - getACL() The $mailbox parameter can no longer be a UTF7-IMAP string. - getCacheId() The $mailbox parameter can no longer be a UTF7-IMAP string. - getMetadata() The $mailbox parameter can no longer be a UTF7-IMAP string. - getMyACLRights() The $mailbox parameter can no longer be a UTF7-IMAP string. - getQuota() The $root parameter can no longer be a UTF7-IMAP string. - getQuotaRoot() The $mailbox parameter can no longer be a UTF7-IMAP string. - listACLRights() The $mailbox parameter can no longer be a UTF7-IMAP string. - listMailboxes() The return array keys are in UTF-8 (not UTF7-IMAP). The 'mailbox' return value is returned as a Horde_Imap_Client_Mailbox object. The 'utf8' parameter has been removed. The 'pattern' parameter now handles Horde_Imap_Client_Mailbox objects differently than string patterns. - openMailbox() The $mailbox parameter can no longer be a UTF7-IMAP string. - parseCommandArray() This method has been removed. - renameMailbox() The $old and $new parameters can no longer be UTF7-IMAP strings. - search() The $mailbox parameter can no longer be a UTF7-IMAP string. The following constants for use with 'results' have been deprecated (use SEARCH_RESULTS_* constants instead): - SORT_RESULTS_COUNT - SORT_RESULTS_MATCH - SORT_RESULTS_MAX - SORT_RESULTS_MIN - SORT_RESULTS_SAVE - setACL() The $mailbox parameter can no longer be a UTF7-IMAP string. The $options['remove'] parameter has been replaced by a more flexible $options['action'] parameter. To delete all ACLs for an identifier use the new deleteACL() method. - setQuota() The $root parameter can no longer be a UTF7-IMAP string. - status() The $mailbox parameter can no longer be a UTF7-IMAP string. The STATUS_LASTMODSEQ and STATUS_LASTMODSEQUIDS return options have been removed. - statusMultiple() The return array keys are in UTF-8 (not UTF7-IMAP). The $mailboxes parameter can no longer contain UTF7-IMAP strings. - store() The $mailbox parameter can no longer be a UTF7-IMAP string. - subscribeMailbox() The $mailbox parameter can no longer be a UTF7-IMAP string. - thread() The $mailbox parameter can no longer be a UTF7-IMAP string. - Horde_Imap_Client_Cache Removed the singleton() method. The 'hostspec', 'port', and 'username' parameters to the constructor have been removed. - Horde_Imap_Client_Data_Envelope Address entries are now returned as a Horde_Mail_Rfc822_List object. The following properties have been removed: - bcc_decoded - bcc_group - cc_decoded - cc_group - from_decoded - reply_to_decoded - sender_decoded - subject_decoded - to_decoded - to_group - Horde_Imap_Client_Data_Thread - Constructor The format of the first parameter ($data) has changed. - getRawData() This method has been removed. - getThread() This method now returns a list of objects. This is now the way that individual indices of a thread are accessed. - getThreadBase() This method has been removed (see getThread() for replacement). - getThreadIndent() This method has been removed (see getThread() for replacement). - getType() This method has been added. - lastInLevel() This method has been removed (see getThread() for replacement). - messageList() This method now returns the list of IDs in a Horde_Imap_Client_Ids object. - Horde_Imap_Client_Exception These constants have been removed: - DRIVER_NOT_FOUND - POP3_NOT_SUPPORTED - NOSUPPORTIMAPEXT - CATENATE_BADURL - BADSEARCH - Horde_Imap_Client_Exception_NoSupportExtension The $extension property has been added. - Horde_Imap_Client_Mailbox get() no longer supports the null argument to the $utf7imap parameter. - Horde_Imap_Client_Search_Query The $queries argument to andSearch() and orSearch() can be a base query in addition to an array of queries. The second argument to charset() has been changed to a boolean indicating whether the current text queries should be converted to the new charset provided. - Horde_Imap_Client_Sort This class has been removed. Mailbox sorting can now be accomplished with the Horde_Imap_Client_Mailbox_List class. - Horde_Imap_Client_Utf7imap The default argument for the $force parameter to Utf8ToUtf7Imap() has changed to boolean true. - Horde_Imap_Client_Utils This class has been removed. Information on the previous methods (and their replacements, if any) can be found below. - createUrl() This method has been removed. URL creation can now be accomplished with the Horde_Imap_Client_Url object. - escape() This method has been removed. String escaping can now be accomplished via the Horde_Imap_Client_Data_Format_* objects. - fromSequenceString() This method has been removed. Sequence string parsing is now natively supported within the Horde_Imap_Client_Ids object. - getBaseSubject() This method has been removed. Bsae subject determination is now handled by the Horde_Imap_Client_Utils_BaseSubject class. - parseCommandArray() This method has been removed. - parseUrl() This method has been removed. URL parsing can now be accomplished with the Horde_Imap_Client_Url object. - removeBareNewlines() This method has been removed. - stripNonAtomChars() This method has been removed. The same functionality can now be accomplished by using the stripNonAtomCharacters() method of the Horde_Imap_Client_Data_Format_Atom object. - toSequenceString() This method has been removed. Sequence string generation is now natively supported within the Horde_Imap_Client_Ids object. - Horde_Imap_Client_Utils_Pop3 This class has been removed. Upgrading To 1.5.0 ================== The following properties have been added to the Horde_Imap_Client_Data_Envelope object: - bcc_group - cc_group - to_group Address properties (array return values) returned from Horde_Imap_Client_Data_Envelope are now Horde_Mail_Rfc822_Address objects. These objects behave identical to the arrays that were returned previously. The following methods have been added: - Horde_Imap_Client_Base#setParam() Upgrading To 1.4.0 ================== Several exception codes have been deprecated: - DRIVER_NOT_FOUND - CATENATE_BADURL - BADSEARCH These are coding errors, not run-time errors, so SPL Exceptions are thrown instead of Horde_Imap_Client_Exceptions with these codes. These exception codes have also been deprecated: - NOSUPPORTIMAPEXT - POP3_NOTSUPPORTED Instead, a Horde_Imap_Client_Exception_NoSupportExtension will be thrown. This class is an extension of Horde_Imap_Client_Exception, so current try/catch statements will automatically catch these exceptions. Horde_Imap_Client_Exception messages are now translated. Additionally, debug information from the server MAY be available in the 'details' property of the Exception object rather than being added to the error message. Upgrading To 1.3.0 ================== The Cclient drivers have been removed; they are instead mapped to the appropriate Socket drivers. No code needs to be changed for now as this will happen automatically. However, the 'Cclient' and 'Cclient_Pop3' driver names are deprecated and will be removed in 2.0.0. Upgrading To 1.2.0 ================== There has been a major change in the way mailbox names are handled in this version. Due to ambiguities with auto-detecting UTF-8 vs. UTF7-IMAP, all mailbox method parameters and return values are now Horde_Imap_Client_Mailbox objects. These objects, when cast to a string, will return the UTF-8 version of the mailbox. All other non-mailbox strings that previously could be passed in as either UTF7-IMAP or UTF-8 are now REQUIRED to be passed in as UTF-8. Auto-detection will still work, but is deprecated, will be removed in 2.0.0, and is not guaranteed to produce proper results for all mailbox names. Changed Return Values --------------------- The following return values have changed: - Horde_Imap_Client_Base#currentMailbox() If the 'utf8' parameter is true, a Horde_Imap_Client_Mailbox object will be returned (an equivalent string representation to the previous behavior of returning a UTF-8 string). - Horde_Imap_Client_Base#getNamespaces() The return array keys and the 'name' parameter are returned in UTF7-IMAP (the documentation was previously unclear as to the charset of these items). - Horde_Imap_Client_Base#listMailboxes() If both the 'flat' and 'utf8' parameters are true, the array values will be Horde_Imap_Client_Mailbox objects, instead of a string (an equivalent string representation to the previous behavior of returning a UTF-8 string). If the 'flat' parameter is false and the 'utf8' parameter is true, the 'mailbox' array key will be a Horde_Imap_Client_Mailbox object instead of a string (an equivalent string representation to the previous behavior of returning a UTF-8 string). - Horde_Imap_Client_Base#statusMultiple() The return array keys are returned in UTF7-IMAP (the documentation was previously unclear as to the charset of these keys). Deprecated Methods ------------------ The following methods are deprecated and will be removed in 2.0.0: - Horde_Imap_Client_Cache::singleton() Use Horde_Imap_Client_Cache::factory() instead. - Horde_Imap_Client_Base#parseCommandArray() Use Horde_Imap_Client_Utils#parseCommandArray() instead. Deprecated Parameters --------------------- - Horde_Imap_Client_Base#currentMailbox() The 'utf8' parameter has been deprecated. The 'mailbox' return value will exclusively return a Horde_Imap_Client_Mailbox object in 2.0.0. Drivers ------- The unmaintained Mock driver has been removed. Method Parameter Changes ------------------------ - Horde_Imap_Client_Base#append() - Horde_Imap_Client_Base#copy() - Horde_Imap_Client_Base#createMailbox() - Horde_Imap_Client_Base#deleteMailbox() - Horde_Imap_Client_Base#expunge() - Horde_Imap_Client_Base#fetch() - Horde_Imap_Client_Base#fetchFromSectionString() - Horde_Imap_Client_Base#getACL() - Horde_Imap_Client_Base#getCacheId() - Horde_Imap_Client_Base#getMetadata() - Horde_Imap_Client_Base#getMyACLRights() - Horde_Imap_Client_Base#getQuota() - Horde_Imap_Client_Base#getQuotaRoot() - Horde_Imap_Client_Base#listACLRights() - Horde_Imap_Client_Base#openMailbox() - Horde_Imap_Client_Base#renameMailbox() - Horde_Imap_Client_Base#search() - Horde_Imap_Client_Base#setACL() - Horde_Imap_Client_Base#setMetadata() - Horde_Imap_Client_Base#setQuota() - Horde_Imap_Client_Base#status() - Horde_Imap_Client_Base#statusMultiple() - Horde_Imap_Client_Base#store() - Horde_Imap_Client_Base#subscribeMailbox() - Horde_Imap_Client_Base#thread() These methods now require the mailbox parameter(s) to be passed in as either a Horde_Imap_Client_Mailbox object (RECOMMENDED) or a UTF-8 string. Passing in a UTF7-IMAP string is DEPRECATED and will be removed in 2.0.0. (The limitation of allowing UTF7-IMAP strings to be continued to be passed in for now is that auto-detection remains necessary. Passing in UTF-8 strings will thus break for certain mailbox names - the only way to guarantee proper mailbox handling for 1.2.0+ is to pass in Mailbox objects.) - Horde_Imap_Client_Base#getMetadata() The $entries parameter now requires the entries to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the entries as Horde_Imap_Client_Mailbox objects. - Horde_Imap_Client_Base#getNamespaces() The $additional parameter now requires the namespaces to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the namespace names as Horde_Imap_Client_Mailbox objects. - Horde_Imap_Client_Base#listMailboxes() The $pattern parameter now requires the patterns to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 2.0.0. To ensure proper mailbox handling in 1.2.0+, you can pass the patterns as Horde_Imap_Client_Mailbox objects. The 'utf8' parameter has been removed. - Horde_Imap_Client_Base#listACLRights() - Horde_Imap_Client_Base#setACL() The $identifier parameter now requires the identifiers to be passed in as UTF-8 strings ONLY (UTF7-IMAP no longer allowed). Auto-detection will be removed in 1.3. To ensure proper mailbox handling in 1.2.0+, you can pass the identifiers as Horde_Imap_Client_Mailbox objects. - Horde_Imap_Client_Cache#__construct() A new required parameter 'baseob' has been added. This replaces the 'hostspec', 'port', and 'username' parameters, which are deprecated and will be removed in 2.0.0. The 'debug' parameter is now a boolean indicating whether debugging is desired; debug output is now controlled via the Base object passed in through 'baseob'. The old usage - passing in a resource - is IMMEDIATELY deprecated and will be ignored. - Horde_Imap_Client_Utf7imap::Utf8ToUtf7Imap() Added the $force parameter. New Methods ----------- - Horde_Imap_Client_Base#getIdsOb() - Horde_Imap_Client_Base#writeDebug() New Objects ----------- - Horde_Imap_Client_Ids - Horde_Imap_Client_Ids_Pop3 - Horde_Imap_Client_Mailbox - Horde_Imap_Client_Utils_Pop3 Upgrading To 1.1.0 ================== New Object Properties --------------------- - Horde_Imap_Client_Data_Envelope Added properties to obtain MIME decoded envelope information. New properties: 'bcc_decoded', 'cc_decoded', 'from_decoded', 'reply_to_decoded', 'sender_decoded', 'subject_decoded', 'to_decoded' Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Auth/DigestMD5.php0000644000175000007640000001561212267677064024203 0ustar slusarzslusarz * @author Michael Slusarz * @copyright 2002-2003 Richard Heyes * @copyright 2011-2013 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Auth_DigestMD5 { /** * Digest response components. * * @var string */ protected $_response; /** * Generate the Digest-MD5 response. * * @param string $id Authentication id (username). * @param string $pass Password. * @param string $challenge The digest challenge sent by the server. * @param string $hostname The hostname of the machine connecting to. * @param string $service The service name (e.g. 'imap', 'pop3'). * * @throws Horde_Imap_Client_Exception */ public function __construct($id, $pass, $challenge, $hostname, $service) { $challenge = $this->_parseChallenge($challenge); $cnonce = $this->_getCnonce(); $digest_uri = sprintf('%s/%s', $service, $hostname); /* Get response value. */ $A1 = sprintf('%s:%s:%s', pack('H32', hash('md5', sprintf('%s:%s:%s', $id, $challenge['realm'], $pass))), $challenge['nonce'], $cnonce); $A2 = 'AUTHENTICATE:' . $digest_uri; $response_value = hash('md5', sprintf('%s:%s:00000001:%s:auth:%s', hash('md5', $A1), $challenge['nonce'], $cnonce, hash('md5', $A2))); $this->_response = array( 'cnonce' => '"' . $cnonce . '"', 'digest-uri' => '"' . $digest_uri . '"', 'maxbuf' => $challenge['maxbuf'], 'nc' => '00000001', 'nonce' => '"' . $challenge['nonce'] . '"', 'qop' => 'auth', 'response' => $response_value, 'username' => '"' . $id . '"' ); if (strlen($challenge['realm'])) { $this->_response['realm'] = '"' . $challenge['realm'] . '"'; } } /** * Cooerce to string. * * @return string The digest response (not base64 encoded). */ public function __toString() { $out = array(); foreach ($this->_response as $key => $val) { $out[] = $key . '=' . $val; } return implode(',', $out); } /** * Return specific digest response directive. * * @return mixed Requested directive, or null if it does not exist. */ public function __get($name) { return isset($this->_response[$name]) ? $this->_response[$name] : null; } /** * Parses and verifies the digest challenge. * * @param string $challenge The digest challenge * * @return array The parsed challenge as an array with directives as keys. * * @throws Horde_Imap_Client_Exception */ protected function _parseChallenge($challenge) { $tokens = array( 'maxbuf' => 65536, 'realm' => '' ); preg_match_all('/([a-z-]+)=("[^"]+(? * @category Horde * @copyright 2012-2013 Horde LLC * @internal * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Base_Debug { /* Time, in seconds, to be labeled a slow command. */ const SLOW_CMD = 5; /** * Is debugging active? * * @var boolean */ public $debug = true; /** * The debug stream. * * @var resource */ protected $_stream; /** * Timestamp of last command. * * @var integer */ protected $_time = null; /** * Constructor. * * @param mixed $debug The debug target. */ public function __construct($debug) { $this->_stream = is_resource($debug) ? $debug : @fopen($debug, 'a'); register_shutdown_function(array($this, 'shutdown')); } /** * Shutdown function. */ public function shutdown() { if (is_resource($this->_stream)) { fflush($this->_stream); fclose($this->_stream); $this->_stream = null; } } /** * Write client output to debug log. * * @param string $msg Debug message. */ public function client($msg) { $this->_write($msg . "\n", 'C: '); } /** * Write informational message to debug log. * * @param string $msg Debug message. */ public function info($msg) { $this->_write($msg . "\n", '>> '); } /** * Write server output to debug log. * * @param string $msg Debug message. */ public function raw($msg) { $this->_write($msg); } /** * Write server output to debug log. * * @param string $msg Debug message. */ public function server($msg) { $this->_write($msg . "\n", 'S: '); } /** * Write debug information to the output stream. * * @param string $msg Debug data. */ protected function _write($msg, $pre = null) { if (!$this->debug || !$this->_stream) { return; } if (!is_null($pre)) { $new_time = microtime(true); if (is_null($this->_time)) { fwrite( $this->_stream, str_repeat('-', 30) . "\n" . '>> ' . date('r') . "\n" ); } elseif (($diff = ($new_time - $this->_time)) > self::SLOW_CMD) { fwrite( $this->_stream, '>> Slow Command: ' . round($diff, 3) . " seconds\n" ); } $this->_time = $new_time; } fwrite($this->_stream, $pre . $msg); } } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Base/Deprecated.php0000644000175000007640000000703512267677064024467 0ustar slusarzslusarz * @category Horde * @copyright 2012-2013 Horde LLC * @internal * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Base_Deprecated { /** * Returns a unique identifier for the current mailbox status. * * @param Horde_Imap_Client_Base $base_ob The base driver object. * @param mixed $mailbox A mailbox. Either a * Horde_Imap_Client_Mailbox * object or a string (UTF-8). * @param boolean $condstore Is CONDSTORE enabled? * @param array $addl Additional cache info to add to * the cache ID string. * * @return string The cache ID string, which will change when the * composition of the mailbox changes. The uidvalidity * will always be the first element, and will be delimited * by the '|' character. * * @throws Horde_Imap_Client_Exception */ static public function getCacheId($base_ob, $mailbox, $condstore, array $addl = array()) { $query = Horde_Imap_Client::STATUS_UIDVALIDITY | Horde_Imap_Client::STATUS_MESSAGES | Horde_Imap_Client::STATUS_UIDNEXT; /* Use MODSEQ as cache ID if CONDSTORE extension is available. */ if ($condstore) { $query |= Horde_Imap_Client::STATUS_HIGHESTMODSEQ; } else { $query |= Horde_Imap_Client::STATUS_UIDNEXT_FORCE; } $status = $base_ob->status($mailbox, $query); if (empty($status['highestmodseq'])) { $parts = array( 'V' . $status['uidvalidity'], 'U' . $status['uidnext'], 'M' . $status['messages'] ); } else { $parts = array( 'V' . $status['uidvalidity'], 'H' . $status['highestmodseq'] ); } return implode('|', array_merge($parts, $addl)); } /** * Parses a cacheID created by getCacheId(). * * @param string $id The cache ID. * * @return array An array with the following information: * - highestmodseq: (integer) * - messages: (integer) * - uidnext: (integer) * - uidvalidity: (integer) Always present */ static public function parseCacheId($id) { $data = array( 'H' => 'highestmodseq', 'M' => 'messages', 'U' => 'uidnext', 'V' => 'uidvalidity' ); $info = array(); foreach (explode('|', $id) as $part) { if (isset($data[$part[0]])) { $info[$data[$part[0]]] = intval(substr($part, 1)); } } return $info; } } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Base/Mailbox.php0000644000175000007640000001161312267677064024017 0ustar slusarzslusarz * @category Horde * @copyright 2012-2013 Horde LLC * @internal * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Base_Mailbox { /** * Mapping object. * * @var Horde_Imap_Client_Ids_Map */ public $map; /** * Is mailbox opened? * * @var boolean */ public $open; /** * Is mailbox sync'd with remote server (via CONDSTORE/QRESYNC)? * * @var boolean */ public $sync; /** * Status information. * * @var array */ protected $_status = array(); /** * Constructor. */ public function __construct() { $this->reset(); } /** * Get status information for the mailbox. * * @param integer $entry STATUS_* constant. * * @return mixed Status information. */ public function getStatus($entry) { if (isset($this->_status[$entry])) { return $this->_status[$entry]; } switch ($entry) { case Horde_Imap_Client::STATUS_FIRSTUNSEEN: /* If we know there are no messages in the current mailbox, we * know there are no unseen messages. */ return empty($this->_status[Horde_Imap_Client::STATUS_MESSAGES]) ? false : null; case Horde_Imap_Client::STATUS_RECENT_TOTAL: case Horde_Imap_Client::STATUS_SYNCMODSEQ: return 0; case Horde_Imap_Client::STATUS_SYNCFLAGUIDS: case Horde_Imap_Client::STATUS_SYNCVANISHED: return array(); case Horde_Imap_Client::STATUS_PERMFLAGS: /* If PERMFLAGS is not returned by server, must assume that all * flags can be change permanently (RFC 3501 [6.3.1]). */ $flags = isset($this->_status[Horde_Imap_Client::STATUS_FLAGS]) ? $this->_status[Horde_Imap_Client::STATUS_FLAGS] : array(); $flags[] = "\\*"; return $flags; case Horde_Imap_Client::STATUS_UIDNOTSTICKY: /* In the absence of explicit uidnotsticky identification, assume * that UIDs are sticky. */ return false; case Horde_Imap_Client::STATUS_UNSEEN: /* If we know there are no messages in the current mailbox, we * know there are no unseen messages . */ return empty($this->_status[Horde_Imap_Client::STATUS_MESSAGES]) ? 0 : null; default: return null; } } /** * Set status information for the mailbox. * * @param integer $entry STATUS_* constant. * @param mixed $value Status information. */ public function setStatus($entry, $value) { switch ($entry) { case Horde_Imap_Client::STATUS_RECENT: /* Keep track of RECENT_TOTAL information. */ $this->_status[Horde_Imap_Client::STATUS_RECENT_TOTAL] = isset($this->_status[Horde_Imap_Client::STATUS_RECENT_TOTAL]) ? ($this->_status[Horde_Imap_Client::STATUS_RECENT_TOTAL] + $value) : $value; break; case Horde_Imap_Client::STATUS_SYNCMODSEQ: /* This is only set once per access. */ if (isset($this->_status[$entry])) { return; } break; case Horde_Imap_Client::STATUS_SYNCFLAGUIDS: case Horde_Imap_Client::STATUS_SYNCVANISHED: if (!isset($this->_status[$entry])) { $this->_status[$entry] = array(); } $this->_status[$entry] = array_merge($this->_status[$entry], $value); return; } $this->_status[$entry] = $value; } /** * Reset the mailbox information. */ public function reset() { $keep = array( Horde_Imap_Client::STATUS_SYNCFLAGUIDS, Horde_Imap_Client::STATUS_SYNCMODSEQ, Horde_Imap_Client::STATUS_SYNCVANISHED ); foreach (array_diff(array_keys($this->_status), $keep) as $val) { unset($this->_status[$val]); } $this->map = new Horde_Imap_Client_Ids_Map(); $this->open = $this->sync = false; } } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Base/Password.php0000644000175000007640000000150112267677064024221 0ustar slusarzslusarz * @category Horde * @copyright 2013 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client * @since 2.14.0 */ interface Horde_Imap_Client_Base_Password { /** * Return the password to use for the server connection. * * @return string The password. */ public function getPassword(); } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Cache/Backend/Cache.php0000644000175000007640000003371012267677064025111 0ustar slusarzslusarz * @category Horde * @copyright 2005-2013 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Cache_Backend_Cache extends Horde_Imap_Client_Cache_Backend { /** Cache structure version. */ const VERSION = 3; /** * The cache object. * * @var Horde_Cache */ protected $_cache; /** * The working data for the current pageload. All changes take place to * this data. * * @var array */ protected $_data = array(); /** * The list of cache slices loaded. * * @var array */ protected $_loaded = array(); /** * The mapping of UIDs to slices. * * @var array */ protected $_slicemap = array(); /** * The list of items to update: * - add: (array) List of IDs that were added. * - slice: (array) List of slices that were modified. * - slicemap: (boolean) Was slicemap info changed? * * @var array */ protected $_update = array(); /** * Constructor. * * @param array $params Configuration parameters: * */ public function __construct(array $params = array()) { // Default parameters. $params = array_merge(array( 'lifetime' => 604800, 'slicesize' => 50 ), array_filter($params)); if (!isset($params['cacheob'])) { throw new InvalidArgumentException('Missing cacheob parameter.'); } foreach (array('lifetime', 'slicesize') as $val) { $params[$val] = intval($params[$val]); } parent::__construct($params); } /** * Initialization tasks. */ protected function _initOb() { $this->_cache = $this->_params['cacheob']; register_shutdown_function(array($this, 'save')); } /** * Updates the cache. */ public function save() { $lifetime = $this->_params['lifetime']; foreach ($this->_update as $mbox => $val) { $s = &$this->_slicemap[$mbox]; if (!empty($val['add'])) { if ($s['c'] <= $this->_params['slicesize']) { $val['slice'][] = $s['i']; $this->_loadSlice($mbox, $s['i']); } $val['slicemap'] = true; foreach (array_keys(array_flip($val['add'])) as $uid) { if ($s['c']++ > $this->_params['slicesize']) { $s['c'] = 0; $val['slice'][] = ++$s['i']; $this->_loadSlice($mbox, $s['i']); } $s['s'][$uid] = $s['i']; } } if (!empty($val['slice'])) { $d = &$this->_data[$mbox]; $val['slicemap'] = true; foreach (array_keys(array_flip($val['slice'])) as $slice) { $data = array(); foreach (array_keys($s['s'], $slice) as $uid) { $data[$uid] = is_array($d[$uid]) ? serialize($d[$uid]) : $d[$uid]; } $this->_cache->set($this->_getCid($mbox, $slice), serialize($data), $lifetime); } } if (!empty($val['slicemap'])) { $this->_cache->set($this->_getCid($mbox, 'slicemap'), serialize($s), $lifetime); } } $this->_update = array(); } /** */ public function get($mailbox, $uids, $fields, $uidvalid) { $ret = array(); $this->_loadUids($mailbox, $uids, $uidvalid); if (empty($this->_data[$mailbox])) { return $ret; } if (!empty($fields)) { $fields = array_flip($fields); } $ptr = &$this->_data[$mailbox]; foreach (array_intersect($uids, array_keys($ptr)) as $val) { if (is_string($ptr[$val])) { $ptr[$val] = @unserialize($ptr[$val]); } $ret[$val] = (empty($fields) || empty($ptr[$val])) ? $ptr[$val] : array_intersect_key($ptr[$val], $fields); } return $ret; } /** */ public function getCachedUids($mailbox, $uidvalid) { $this->_loadSliceMap($mailbox, $uidvalid); return array_unique(array_merge( array_keys($this->_slicemap[$mailbox]['s']), (isset($this->_update[$mailbox]) ? $this->_update[$mailbox]['add'] : array()) )); } /** */ public function set($mailbox, $data, $uidvalid) { $update = array_keys($data); try { $this->_loadUids($mailbox, $update, $uidvalid); } catch (Horde_Imap_Client_Exception $e) { // Ignore invalidity - just start building the new cache } $d = &$this->_data[$mailbox]; $s = &$this->_slicemap[$mailbox]['s']; $add = $updated = array(); foreach ($data as $k => $v) { if (isset($d[$k])) { if (is_string($d[$k])) { $d[$k] = @unserialize($d[$k]); } $d[$k] = is_array($d[$k]) ? array_merge($d[$k], $v) : $v; if (isset($s[$k])) { $updated[$s[$k]] = true; } } else { $d[$k] = $v; $add[] = $k; } } $this->_toUpdate($mailbox, 'add', $add); $this->_toUpdate($mailbox, 'slice', array_keys($updated)); } /** */ public function getMetaData($mailbox, $uidvalid, $entries) { $this->_loadSliceMap($mailbox, $uidvalid); return empty($entries) ? $this->_slicemap[$mailbox]['d'] : array_intersect_key($this->_slicemap[$mailbox]['d'], array_flip($entries)); } /** */ public function setMetaData($mailbox, $data) { $this->_loadSliceMap($mailbox, isset($data['uidvalid']) ? $data['uidvalid'] : null); $this->_slicemap[$mailbox]['d'] = array_merge($this->_slicemap[$mailbox]['d'], $data); $this->_toUpdate($mailbox, 'slicemap', true); } /** */ public function deleteMsgs($mailbox, $uids) { $this->_loadSliceMap($mailbox); $slicemap = &$this->_slicemap[$mailbox]; $deleted = array_intersect_key($slicemap['s'], array_flip($uids)); if (isset($this->_update[$mailbox])) { $this->_update[$mailbox]['add'] = array_diff( $this->_update[$mailbox]['add'], $uids ); } if (empty($deleted)) { return; } $this->_loadUids($mailbox, array_keys($deleted)); $d = &$this->_data[$mailbox]; foreach (array_keys($deleted) as $id) { unset($d[$id], $slicemap['s'][$id]); } foreach (array_unique($deleted) as $slice) { /* Get rid of slice if less than 10% of capacity. */ if (($slice != $slicemap['i']) && ($slice_uids = array_keys($slicemap['s'], $slice)) && ($this->_params['slicesize'] * 0.1) > count($slice_uids)) { $this->_toUpdate($mailbox, 'add', $slice_uids); $this->_cache->expire($this->_getCid($mailbox, $slice)); foreach ($slice_uids as $val) { unset($slicemap['s'][$val]); } } else { $this->_toUpdate($mailbox, 'slice', array($slice)); } } } /** */ public function deleteMailbox($mailbox) { $this->_loadSliceMap($mailbox); $this->_deleteMailbox($mailbox); } /** */ public function clear($lifetime) { $this->_cache->clear(); $this->_data = $this->_loaded = $this->_slicemap = $this->_update = array(); } /** * Create the unique ID used to store the data in the cache. * * @param string $mailbox The mailbox to cache. * @param string $slice The cache slice. * * @return string The cache ID. */ protected function _getCid($mailbox, $slice) { return implode('|', array( 'horde_imap_client', $this->_params['username'], $mailbox, $this->_params['hostspec'], $this->_params['port'], $slice, self::VERSION )); } /** * Delete a mailbox from the cache. * * @param string $mbox The mailbox to delete. */ protected function _deleteMailbox($mbox) { foreach (array_merge(array_keys(array_flip($this->_slicemap[$mbox]['s'])), array('slicemap')) as $slice) { $cid = $this->_getCid($mbox, $slice); $this->_cache->expire($cid); unset($this->_loaded[$cid]); } unset( $this->_data[$mbox], $this->_slicemap[$mbox], $this->_update[$mbox] ); } /** * Load UIDs by regenerating from the cache. * * @param string $mailbox The mailbox to load. * @param array $uids The UIDs to load. * @param integer $uidvalid The IMAP uidvalidity value of the mailbox. */ protected function _loadUids($mailbox, $uids, $uidvalid = null) { if (!isset($this->_data[$mailbox])) { $this->_data[$mailbox] = array(); } $this->_loadSliceMap($mailbox, $uidvalid); if (!empty($uids)) { foreach (array_unique(array_intersect_key($this->_slicemap[$mailbox]['s'], array_flip($uids))) as $slice) { $this->_loadSlice($mailbox, $slice); } } } /** * Load UIDs from a cache slice. * * @param string $mailbox The mailbox to load. * @param integer $slice The slice to load. */ protected function _loadSlice($mailbox, $slice) { $cache_id = $this->_getCid($mailbox, $slice); if (!empty($this->_loaded[$cache_id])) { return; } if ((($data = $this->_cache->get($cache_id, 0)) !== false) && ($data = @unserialize($data)) && is_array($data)) { $this->_data[$mailbox] += $data; $this->_loaded[$cache_id] = true; } else { $ptr = &$this->_slicemap[$mailbox]; // Slice data is corrupt; remove from slicemap. foreach (array_keys($ptr['s'], $slice) as $val) { unset($ptr['s'][$val]); } if ($slice == $ptr['i']) { $ptr['c'] = 0; } } } /** * Load the slicemap for a given mailbox. The slicemap contains * the uidvalidity information, the UIDs->slice lookup table, and any * metadata that needs to be saved for the mailbox. * * @param string $mailbox The mailbox. * @param integer $uidvalid The IMAP uidvalidity value of the mailbox. */ protected function _loadSliceMap($mailbox, $uidvalid = null) { if (!isset($this->_slicemap[$mailbox]) && (($data = $this->_cache->get($this->_getCid($mailbox, 'slicemap'), 0)) !== false) && ($slice = @unserialize($data)) && is_array($slice)) { $this->_slicemap[$mailbox] = $slice; } if (isset($this->_slicemap[$mailbox])) { $ptr = &$this->_slicemap[$mailbox]; if (is_null($ptr['d']['uidvalid'])) { $ptr['d']['uidvalid'] = $uidvalid; return; } elseif (!is_null($uidvalid) && ($ptr['d']['uidvalid'] != $uidvalid)) { $this->_deleteMailbox($mailbox); } else { return; } } $this->_slicemap[$mailbox] = array( // Tracking count for purposes of determining slices 'c' => 0, // Metadata storage // By default includes UIDVALIDITY of mailbox. 'd' => array('uidvalid' => $uidvalid), // The ID of the last slice. 'i' => 0, // The slice list. 's' => array() ); } /** * Add update entry for a mailbox. * * @param string $mailbox The mailbox. * @param string $type 'add', 'slice', or 'slicemap'. * @param mixed $data The data to update. */ protected function _toUpdate($mailbox, $type, $data) { if (!isset($this->_update[$mailbox])) { $this->_update[$mailbox] = array( 'add' => array(), 'slice' => array() ); } $this->_update[$mailbox][$type] = ($type == 'slicemap') ? $data : array_merge($this->_update[$mailbox][$type], $data); } /* Serializable methods. */ /** */ public function serialize() { $this->save(); return parent::serialize(); } } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Cache/Backend/Db.php0000644000175000007640000002714112267677064024434 0ustar slusarzslusarz * @category Horde * @copyright 2013 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client */ class Horde_Imap_Client_Cache_Backend_Db extends Horde_Imap_Client_Cache_Backend { /* Table names. */ const BASE_TABLE = 'horde_imap_client_data'; const MD_TABLE = 'horde_imap_client_metadata'; const MSG_TABLE = 'horde_imap_client_message'; /** * Handle for the database connection. * * @var Horde_Db_Adapter */ protected $_db; /** * Constructor. * * @param array $params Configuration parameters: * */ public function __construct(array $params = array()) { if (!isset($params['db'])) { throw new InvalidArgumentException('Missing db parameter.'); } parent::__construct($params); } /** */ protected function _initOb() { $this->_db = $this->_params['db']; } /** */ public function get($mailbox, $uids, $fields, $uidvalid) { $this->getMetaData($mailbox, $uidvalid, array('uidvalid')); $query = $this->_baseSql($mailbox, self::MSG_TABLE); $query[0] = 'SELECT t.data, t.msguid ' . $query[0]; $uid_query = array(); foreach ($uids as $val) { $uid_query[] = 't.msguid = ?'; $query[1][] = strval($val); } $query[0] .= ' AND (' . implode(' OR ', $uid_query) . ')'; $compress = new Horde_Compress_Fast(); $out = array(); try { $columns = $this->_db->columns(self::MSG_TABLE); $res = $this->_db->select($query[0], $query[1]); foreach ($res as $row) { $out[$row['msguid']] = @unserialize($compress->decompress( $columns['data']->binaryToString($row['data']) )); } } catch (Horde_Db_Exception $e) {} return $out; } /** */ public function getCachedUids($mailbox, $uidvalid) { $this->getMetaData($mailbox, $uidvalid, array('uidvalid')); $query = $this->_baseSql($mailbox, self::MSG_TABLE); $query[0] = 'SELECT DISTINCT t.msguid ' . $query[0]; try { return $this->_db->selectValues($query[0], $query[1]); } catch (Horde_Db_Exception $e) { return array(); } } /** */ public function set($mailbox, $data, $uidvalid) { if ($uid = $this->_getUid($mailbox)) { $res = $this->get($mailbox, array_keys($data), array(), $uidvalid); } else { $res = array(); $uid = $this->_createUid($mailbox); } $compress = new Horde_Compress_Fast(); foreach ($data as $key => $val) { if (isset($res[$key])) { try { /* Update */ $this->_db->update( sprintf('UPDATE %s SET data = ? WHERE uid = ? AND msguid = ?', self::MSG_TABLE), array( new Horde_Db_Value_Binary($compress->compress(serialize(array_merge($res[$key], $val)))), $uid, strval($key) ) ); } catch (Horde_Db_Exception $e) {} } else { /* Insert */ try { $this->_db->insert( sprintf('INSERT INTO %s (data, msguid, uid) VALUES (?, ?, ?)', self::MSG_TABLE), array( new Horde_Db_Value_Binary($compress->compress(serialize($val))), strval($key), $uid ) ); } catch (Horde_Db_Exception $e) {} } } /* Update modified time. */ try { $this->_db->update( sprintf( 'UPDATE %s SET modified = ? WHERE uid = ?', self::BASE_TABLE ), array(time(), $uid) ); } catch (Horde_Db_Exception $e) {} /* Update uidvalidity. */ $this->setMetaData($mailbox, array('uidvalid' => $uidvalid)); } /** */ public function getMetaData($mailbox, $uidvalid, $entries) { $query = $this->_baseSql($mailbox, self::MD_TABLE); $query[0] = 'SELECT t.field, t.data ' . $query[0]; if (!empty($entries)) { $entries[] = 'uidvalid'; $entry_query = array(); foreach (array_unique($entries) as $val) { $entry_query[] = 't.field = ?'; $query[1][] = $val; } $query[0] .= ' AND (' . implode(' OR ', $entry_query) . ')'; } try { if ($res = $this->_db->selectAssoc($query[0], $query[1])) { $columns = $this->_db->columns(self::MD_TABLE); foreach ($res as $key => $val) { switch ($key) { case 'uidvalid': $res[$key] = $columns['data']->binaryToString($val); break; default: $res[$key] = @unserialize( $columns['data']->binaryToString($val) ); break; } } if (is_null($uidvalid) || !isset($res['uidvalid']) || ($res['uidvalid'] == $uidvalid)) { return $res; } $this->deleteMailbox($mailbox); } } catch (Horde_Db_Exception $e) {} return array(); } /** */ public function setMetaData($mailbox, $data) { if (!($uid = $this->_getUid($mailbox))) { $uid = $this->_createUid($mailbox); } $query = sprintf('SELECT field FROM %s where uid = ?', self::MD_TABLE); $values = array($uid); try { $fields = $this->_db->selectValues($query, $values); } catch (Horde_Db_Exception $e) { return; } foreach ($data as $key => $val) { $val = new Horde_Db_Value_Binary(($key == 'uidvalid') ? $val : serialize($val)); if (in_array($key, $fields)) { /* Update */ try { $this->_db->update( sprintf( 'UPDATE %s SET data = ? WHERE field = ? AND uid = ?', self::MD_TABLE ), array($val, $key, $uid) ); } catch (Horde_Db_Exception $e) {} } else { /* Insert */ try { $this->_db->insert( sprintf( 'INSERT INTO %s (data, field, uid) VALUES (?, ?, ?)', self::MD_TABLE ), array($val, $key, $uid) ); } catch (Horde_Db_Exception $e) {} } } } /** */ public function deleteMsgs($mailbox, $uids) { $query = $this->_baseSql($mailbox); $query[0] = sprintf( 'DELETE FROM %s WHERE uid IN (SELECT uid ' . $query[0] . ')', self::MSG_TABLE ); $uid_query = array(); foreach ($uids as $val) { $uid_query[] = 'msguid = ?'; $query[1][] = strval($val); } $query[0] .= ' AND (' . implode(' OR ', $uid_query) . ')'; try { $this->_db->delete($query[0], $query[1]); } catch (Horde_Db_Exception $e) {} } /** */ public function deleteMailbox($mailbox) { if (is_null($uid = $this->_getUid($mailbox))) { return; } foreach (array(self::BASE_TABLE, self::MD_TABLE, self::MSG_TABLE) as $val) { try { $this->_db->delete( sprintf('DELETE FROM %s WHERE uid = ?', $val), array($uid) ); } catch (Horde_Db_Exception $e) {} } } /** */ public function clear($lifetime) { if (is_null($lifetime)) { try { $this->_db->delete(sprintf('DELETE FROM %s', self::BASE_TABLE)); $this->_db->delete(sprintf('DELETE FROM %s', self::MD_TABLE)); $this->_db->delete(sprintf('DELETE FROM %s', self::MSG_TABLE)); } catch (Horde_Db_Exception $e) {} return; } $purge = time() - $lifetime; $sql = 'DELETE FROM %s WHERE uid IN (SELECT uid FROM %s WHERE modified < ?'; foreach (array(self::MD_TABLE, self::MSG_TABLE) as $val) { try { $this->_db->delete( sprintf($sql, $val, self::BASE_TABLE), array($purge) ); } catch (Horde_Db_Exception $e) {} } try { $this->_db->delete( sprintf('DELETE FROM %s WHERE modified < ?', self::BASE_TABLE), array($purge) ); } catch (Horde_Db_Exception $e) {} } /** * Prepare the base SQL query. * * @param string $mailbox The mailbox. * @param string $join The table to join with the base table. * * @return array SQL query and bound parameters. */ protected function _baseSql($mailbox, $join = null) { $sql = sprintf('FROM %s d', self::BASE_TABLE); if (!is_null($join)) { $sql .= sprintf(' INNER JOIN %s t ON d.uid = t.uid', $join); } return array( $sql . ' WHERE d.hostspec = ? AND d.port = ? AND d.username = ? AND d.mailbox = ?', array( $this->_params['hostspec'], $this->_params['port'], $this->_params['username'], $mailbox ) ); } /** * @param string $mailbox * * @return string UID from base table. */ protected function _getUid($mailbox) { $query = $this->_baseSql($mailbox); $query[0] = 'SELECT d.uid ' . $query[0]; try { return $this->_db->selectValue($query[0], $query[1]); } catch (Horde_Db_Exception $e) { return null; } } /** * @param string $mailbox * * @return string UID from base table. */ protected function _createUid($mailbox) { return $this->_db->insert( sprintf( 'INSERT INTO %s (hostspec, mailbox, port, username) ' . 'VALUES (?, ?, ?, ?)', self::BASE_TABLE ), array( $this->_params['hostspec'], $mailbox, $this->_params['port'], $this->_params['username'] ) ); } } Horde_Imap_Client-2.17.1/lib/Horde/Imap/Client/Cache/Backend/Hashtable.php0000644000175000007640000002462312267677064026004 0ustar slusarzslusarz * @category Horde * @copyright 2013 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Imap_Client * @since 2.17.0 */ class Horde_Imap_Client_Cache_Backend_Hashtable extends Horde_Imap_Client_Cache_Backend { /** Separator for CID between mailbox and UID. */ const CID_SEPARATOR = '|'; /** * The working data for the current pageload. All changes take place to * this data. * * @var array */ protected $_data = array(); /** * HashTable object. * * @var Horde_HashTable */ protected $_hash; /** * Mailbox level data. * * @var array */ protected $_mbox = array(); /** * Horde_Pack singleton object. * * @var Horde_Pack */ protected $_pack; /** * List of mailbox/UIDs to update. * Keys are mailboxes. Values are arrays with three possible keys: *
     *   - d: UIDs to delete
     *   - m: Was metadata updated?
     *   - u: UIDs to update
     * 
* * @var array */ protected $_update = array(); /** * Constructor. * * @param array $params Configuration parameters: *