From: Chuck Hagenbuch Date: Tue, 2 Dec 2008 18:54:24 +0000 (-0500) Subject: make this file autoloadable X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f35649d1f75861bc5f860591b95b5e1a3077c565;p=horde.git make this file autoloadable --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Cclient-pop3.php b/framework/Imap_Client/lib/Horde/Imap/Client/Cclient-pop3.php deleted file mode 100644 index ebfc542ff..000000000 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Cclient-pop3.php +++ /dev/null @@ -1,437 +0,0 @@ - - * @category Horde - * @package Horde_Imap_Client - */ -class Horde_Imap_Client_Cclient_pop3 extends Horde_Imap_Client_Cclient -{ - /** - * Constructs a new Horde_Imap_Client_Cclient object. - * - * @param array $params A hash containing configuration parameters. - */ - public function __construct($params) - { - $this->_service = 'pop3'; - if (!isset($params['port'])) { - $params['port'] = ($params['secure'] == 'ssl') ? 995 : 110; - } - parent::__construct($params); - } - - /** - * Get CAPABILITY info from the IMAP server. - * Throws a Horde_Imap_Client_Exception on error. - */ - protected function _capability() - { - throw new Horde_Imap_Client_Exception('IMAP CAPABILITY command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get the NAMESPACE information from the IMAP server. - * Throws a Horde_Imap_Client_Exception on error. - */ - protected function _getNamespaces() - { - throw new Horde_Imap_Client_Exception('IMAP namespaces not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Send ID information to the IMAP server (RFC 2971). - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $info The information to send to the server. - */ - protected function _sendID($info) - { - throw new Horde_Imap_Client_Exception('IMAP ID command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Return ID information from the IMAP server (RFC 2971). - * Throws a Horde_Imap_Client_Exception on error. - */ - protected function _getID() - { - throw new Horde_Imap_Client_Exception('IMAP ID command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Sets the preferred language for server response messages (RFC 5255). - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $info The preferred list of languages. - * - * @return string The language accepted by the server, or null if the - * default language is used. - */ - protected function _setLanguage($langs) - { - throw new Horde_Imap_Client_Exception('IMAP LANGUAGE extension not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Gets the preferred language for server response messages (RFC 5255). - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $list If true, return the list of available languages. - */ - protected function _getLanguage($list) - { - throw new Horde_Imap_Client_Exception('IMAP LANGUAGE extension not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Open a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to open (UTF7-IMAP). - * @param integer $mode The access mode. - */ - protected function _openMailbox($mailbox, $mode) - { - if (strcasecmp($mailbox, 'INBOX') !== 0) { - throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - } - - /** - * Create a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to create (UTF7-IMAP). - */ - protected function _createMailbox($mailbox) - { - throw new Horde_Imap_Client_Exception('Creating mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Delete a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to delete (UTF7-IMAP). - */ - protected function _deleteMailbox($mailbox) - { - throw new Horde_Imap_Client_Exception('Deleting mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Rename a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $old The old mailbox name (UTF7-IMAP). - * @param string $new The new mailbox name (UTF7-IMAP). - */ - protected function _renameMailbox($old, $new) - { - throw new Horde_Imap_Client_Exception('Renaming mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Manage subscription status for a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to [un]subscribe to (UTF7-IMAP). - * @param boolean $subscribe True to subscribe, false to unsubscribe. - */ - protected function _subscribeMailbox($mailbox, $subscribe) - { - throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Unsubscribe to a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to unsubscribe to (UTF7-IMAP). - */ - protected function _unsubscribeMailbox($mailbox) - { - throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Obtain a list of mailboxes matching a pattern. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $pattern The mailbox search pattern. - * @param integer $mode Which mailboxes to return. - * @param array $options Additional options. - * - * @return array See Horde_Imap_Client_Base::listMailboxes(). - */ - protected function _listMailboxes($pattern, $mode, $options) - { - $tmp = array('mailbox' => 'INBOX'); - - if (!empty($options['attributes'])) { - $tmp['attributes'] = array(); - } - if (!empty($options['delimiter'])) { - $tmp['delimiter'] = ''; - } - - return array('INBOX' => $tmp); - } - - /** - * Obtain status information for a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox The mailbox to query (UTF7-IMAP). - * @param string $flags A bitmask of information requested from the - * server. - * - * @return array See Horde_Imap_Client_Base::status(). - */ - protected function _status($mailbox, $flags) - { - if (strcasecmp($mailbox, 'INBOX') !== 0) { - throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - // This driver only supports the base flags given by c-client. - if (($flags & Horde_Imap_Client::STATUS_FIRSTUNSEEN) || - ($flags & Horde_Imap_Client::STATUS_FLAGS) || - ($flags & Horde_Imap_Client::STATUS_PERMFLAGS)) { - throw new Horde_Imap_Client_Exception('Improper status request on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - return parent::_status($mailbox, $flags); - } - - /** - * Search a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param object $query The search string. - * @param array $options Additional options. - * - * @return array An array of UIDs (default) or an array of message - * sequence numbers (if 'sequence' is true). - */ - protected function _search($query, $options) - { - // POP 3 supports c-client search criteria only. - $search_query = $query->build(); - - /* If more than 1 sort criteria given, or if SORT_REVERSE is given - * as a sort criteria, or search query uses IMAP4 criteria, use the - * Socket client instead. */ - if ($search_query['imap4'] || - (!empty($options['sort']) && - ((count($options['sort']) > 1) || - in_array(self::SORT_REVERSE, $options['sort'])))) { - throw new Horde_Imap_Client_Exception('Unsupported search criteria on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - return parent::_search($query, $options); - } - - /** - * Set the comparator to use for searching/sorting (RFC 5255). - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $comparator The comparator string (see RFC 4790 [3.1] - - * "collation-id" - for format). The reserved - * string 'default' can be used to select - * the default comparator. - */ - protected function _setComparator($comparator) - { - throw new Horde_Imap_Client_Exception('Search comparators not supported on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get the comparator used for searching/sorting (RFC 5255). - * Throws a Horde_Imap_Client_Exception on error. - */ - protected function _getComparator() - { - throw new Horde_Imap_Client_Exception('Search comparators not supported on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Thread sort a given list of messages (RFC 5256). - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $options Additional options. - * - * @return array See Horde_Imap_Client_Base::thread(). - */ - protected function _thread($options) - { - /* This driver only supports Horde_Imap_Client::THREAD_REFERENCES - * and does not support defining search criteria. */ - if (!empty($options['search']) || - (!empty($options['criteria']) && - $options['criteria'] != self::THREAD_REFERENCES)) { - throw new Horde_Imap_Client_Exception('Unsupported threading criteria on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - return parent::_thread($options); - } - - /** - * Append a message to the mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $mailbox The mailboxes to append the messages to - * (UTF7-IMAP). - * @param array $data The message data. - * @param array $options Additional options. - */ - protected function _append($mailbox, $data, $options) - { - throw new Horde_Imap_Client_Exception('Appending messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Fetch message data. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $criteria The fetch criteria. - * @param array $options Additional options. - * - * @return array See self::fetch(). - */ - protected function _fetch($criteria, $options) - { - // No support for FETCH_MIMEHEADER or FETCH_HEADERS - $nosupport = array(self::FETCH_MIMEHEADER, self::FETCH_HEADERS); - - reset($criteria); - while (list($val,) = each($criteria)) { - if (in_array($val, $nosupport)) { - throw new Horde_Imap_Client_Exception('Fetch criteria provided not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - } - - return parent::_fetch($criteria, $options); - } - - /** - * Store message flag data. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param array $options Additional options. - */ - protected function _store($options) - { - throw new Horde_Imap_Client_Exception('Flagging messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Copy messages to another mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $dest The destination mailbox (UTF7-IMAP). - * @param array $options Additional options. - */ - protected function _copy($dest, $options) - { - throw new Horde_Imap_Client_Exception('Copying messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Set quota limits. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $root The quota root (UTF7-IMAP). - * @param array $options Additional options. - */ - protected function _setQuota($root, $options) - { - throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get quota limits. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $root The quota root (UTF7-IMAP). - */ - protected function _getQuota($root) - { - throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get quota limits for a mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox A mailbox (UTF7-IMAP). - */ - protected function _getQuotaRoot($mailbox) - { - throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Set ACL rights for a given mailbox/identifier. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox A mailbox (UTF7-IMAP). - * @param string $identifier The identifier to alter (UTF7-IMAP). - * @param array $options Additional options. - */ - protected function _setACL($mailbox, $identifier, $options) - { - throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get ACL rights for a given mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox A mailbox (UTF7-IMAP). - */ - protected function _getACL($mailbox) - { - throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get ACL rights for a given mailbox/identifier. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox A mailbox (UTF7-IMAP). - * @param string $identifier The identifier (UTF7-IMAP). - */ - protected function _listACLRights($mailbox, $identifier) - { - throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - - /** - * Get the ACL rights for the current user for a given mailbox. - * Throws a Horde_Imap_Client_Exception on error. - * - * @param string $mailbox A mailbox (UTF7-IMAP). - */ - protected function _getMyACLRights($mailbox) - { - throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); - } - -} diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Cclient/Pop3.php b/framework/Imap_Client/lib/Horde/Imap/Client/Cclient/Pop3.php new file mode 100644 index 000000000..222a7bf1b --- /dev/null +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Cclient/Pop3.php @@ -0,0 +1,434 @@ + + * @category Horde + * @package Horde_Imap_Client + */ +class Horde_Imap_Client_Cclient_Pop3 extends Horde_Imap_Client_Cclient +{ + /** + * Constructs a new Horde_Imap_Client_Cclient object. + * + * @param array $params A hash containing configuration parameters. + */ + public function __construct($params) + { + $this->_service = 'pop3'; + if (!isset($params['port'])) { + $params['port'] = ($params['secure'] == 'ssl') ? 995 : 110; + } + parent::__construct($params); + } + + /** + * Get CAPABILITY info from the IMAP server. + * Throws a Horde_Imap_Client_Exception on error. + */ + protected function _capability() + { + throw new Horde_Imap_Client_Exception('IMAP CAPABILITY command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get the NAMESPACE information from the IMAP server. + * Throws a Horde_Imap_Client_Exception on error. + */ + protected function _getNamespaces() + { + throw new Horde_Imap_Client_Exception('IMAP namespaces not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Send ID information to the IMAP server (RFC 2971). + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $info The information to send to the server. + */ + protected function _sendID($info) + { + throw new Horde_Imap_Client_Exception('IMAP ID command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Return ID information from the IMAP server (RFC 2971). + * Throws a Horde_Imap_Client_Exception on error. + */ + protected function _getID() + { + throw new Horde_Imap_Client_Exception('IMAP ID command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Sets the preferred language for server response messages (RFC 5255). + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $info The preferred list of languages. + * + * @return string The language accepted by the server, or null if the + * default language is used. + */ + protected function _setLanguage($langs) + { + throw new Horde_Imap_Client_Exception('IMAP LANGUAGE extension not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Gets the preferred language for server response messages (RFC 5255). + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $list If true, return the list of available languages. + */ + protected function _getLanguage($list) + { + throw new Horde_Imap_Client_Exception('IMAP LANGUAGE extension not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Open a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to open (UTF7-IMAP). + * @param integer $mode The access mode. + */ + protected function _openMailbox($mailbox, $mode) + { + if (strcasecmp($mailbox, 'INBOX') !== 0) { + throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + } + + /** + * Create a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to create (UTF7-IMAP). + */ + protected function _createMailbox($mailbox) + { + throw new Horde_Imap_Client_Exception('Creating mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Delete a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to delete (UTF7-IMAP). + */ + protected function _deleteMailbox($mailbox) + { + throw new Horde_Imap_Client_Exception('Deleting mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Rename a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $old The old mailbox name (UTF7-IMAP). + * @param string $new The new mailbox name (UTF7-IMAP). + */ + protected function _renameMailbox($old, $new) + { + throw new Horde_Imap_Client_Exception('Renaming mailboxes not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Manage subscription status for a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to [un]subscribe to (UTF7-IMAP). + * @param boolean $subscribe True to subscribe, false to unsubscribe. + */ + protected function _subscribeMailbox($mailbox, $subscribe) + { + throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Unsubscribe to a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to unsubscribe to (UTF7-IMAP). + */ + protected function _unsubscribeMailbox($mailbox) + { + throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Obtain a list of mailboxes matching a pattern. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $pattern The mailbox search pattern. + * @param integer $mode Which mailboxes to return. + * @param array $options Additional options. + * + * @return array See Horde_Imap_Client_Base::listMailboxes(). + */ + protected function _listMailboxes($pattern, $mode, $options) + { + $tmp = array('mailbox' => 'INBOX'); + + if (!empty($options['attributes'])) { + $tmp['attributes'] = array(); + } + if (!empty($options['delimiter'])) { + $tmp['delimiter'] = ''; + } + + return array('INBOX' => $tmp); + } + + /** + * Obtain status information for a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox The mailbox to query (UTF7-IMAP). + * @param string $flags A bitmask of information requested from the + * server. + * + * @return array See Horde_Imap_Client_Base::status(). + */ + protected function _status($mailbox, $flags) + { + if (strcasecmp($mailbox, 'INBOX') !== 0) { + throw new Horde_Imap_Client_Exception('Mailboxes other than INBOX not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + // This driver only supports the base flags given by c-client. + if (($flags & Horde_Imap_Client::STATUS_FIRSTUNSEEN) || + ($flags & Horde_Imap_Client::STATUS_FLAGS) || + ($flags & Horde_Imap_Client::STATUS_PERMFLAGS)) { + throw new Horde_Imap_Client_Exception('Improper status request on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + return parent::_status($mailbox, $flags); + } + + /** + * Search a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param object $query The search string. + * @param array $options Additional options. + * + * @return array An array of UIDs (default) or an array of message + * sequence numbers (if 'sequence' is true). + */ + protected function _search($query, $options) + { + // POP 3 supports c-client search criteria only. + $search_query = $query->build(); + + /* If more than 1 sort criteria given, or if SORT_REVERSE is given + * as a sort criteria, or search query uses IMAP4 criteria, use the + * Socket client instead. */ + if ($search_query['imap4'] || + (!empty($options['sort']) && + ((count($options['sort']) > 1) || + in_array(self::SORT_REVERSE, $options['sort'])))) { + throw new Horde_Imap_Client_Exception('Unsupported search criteria on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + return parent::_search($query, $options); + } + + /** + * Set the comparator to use for searching/sorting (RFC 5255). + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $comparator The comparator string (see RFC 4790 [3.1] - + * "collation-id" - for format). The reserved + * string 'default' can be used to select + * the default comparator. + */ + protected function _setComparator($comparator) + { + throw new Horde_Imap_Client_Exception('Search comparators not supported on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get the comparator used for searching/sorting (RFC 5255). + * Throws a Horde_Imap_Client_Exception on error. + */ + protected function _getComparator() + { + throw new Horde_Imap_Client_Exception('Search comparators not supported on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Thread sort a given list of messages (RFC 5256). + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $options Additional options. + * + * @return array See Horde_Imap_Client_Base::thread(). + */ + protected function _thread($options) + { + /* This driver only supports Horde_Imap_Client::THREAD_REFERENCES + * and does not support defining search criteria. */ + if (!empty($options['search']) || + (!empty($options['criteria']) && + $options['criteria'] != self::THREAD_REFERENCES)) { + throw new Horde_Imap_Client_Exception('Unsupported threading criteria on POP3 server.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + return parent::_thread($options); + } + + /** + * Append a message to the mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $mailbox The mailboxes to append the messages to + * (UTF7-IMAP). + * @param array $data The message data. + * @param array $options Additional options. + */ + protected function _append($mailbox, $data, $options) + { + throw new Horde_Imap_Client_Exception('Appending messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Fetch message data. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $criteria The fetch criteria. + * @param array $options Additional options. + * + * @return array See self::fetch(). + */ + protected function _fetch($criteria, $options) + { + // No support for FETCH_MIMEHEADER or FETCH_HEADERS + $nosupport = array(self::FETCH_MIMEHEADER, self::FETCH_HEADERS); + + reset($criteria); + while (list($val,) = each($criteria)) { + if (in_array($val, $nosupport)) { + throw new Horde_Imap_Client_Exception('Fetch criteria provided not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + } + + return parent::_fetch($criteria, $options); + } + + /** + * Store message flag data. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param array $options Additional options. + */ + protected function _store($options) + { + throw new Horde_Imap_Client_Exception('Flagging messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Copy messages to another mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $dest The destination mailbox (UTF7-IMAP). + * @param array $options Additional options. + */ + protected function _copy($dest, $options) + { + throw new Horde_Imap_Client_Exception('Copying messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Set quota limits. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $root The quota root (UTF7-IMAP). + * @param array $options Additional options. + */ + protected function _setQuota($root, $options) + { + throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get quota limits. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $root The quota root (UTF7-IMAP). + */ + protected function _getQuota($root) + { + throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get quota limits for a mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox A mailbox (UTF7-IMAP). + */ + protected function _getQuotaRoot($mailbox) + { + throw new Horde_Imap_Client_Exception('IMAP quotas not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Set ACL rights for a given mailbox/identifier. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox A mailbox (UTF7-IMAP). + * @param string $identifier The identifier to alter (UTF7-IMAP). + * @param array $options Additional options. + */ + protected function _setACL($mailbox, $identifier, $options) + { + throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get ACL rights for a given mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox A mailbox (UTF7-IMAP). + */ + protected function _getACL($mailbox) + { + throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get ACL rights for a given mailbox/identifier. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox A mailbox (UTF7-IMAP). + * @param string $identifier The identifier (UTF7-IMAP). + */ + protected function _listACLRights($mailbox, $identifier) + { + throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + + /** + * Get the ACL rights for the current user for a given mailbox. + * Throws a Horde_Imap_Client_Exception on error. + * + * @param string $mailbox A mailbox (UTF7-IMAP). + */ + protected function _getMyACLRights($mailbox) + { + throw new Horde_Imap_Client_Exception('IMAP ACLs not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED); + } + +} diff --git a/framework/Imap_Client/package.xml b/framework/Imap_Client/package.xml index a88d2e8d7..bc014eed6 100644 --- a/framework/Imap_Client/package.xml +++ b/framework/Imap_Client/package.xml @@ -40,10 +40,12 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + - @@ -97,8 +99,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> + - diff --git a/framework/Imap_Client/test/Horde/Imap/test_client.php b/framework/Imap_Client/test/Horde/Imap/test_client.php index c21e5cc7d..e921af91b 100644 --- a/framework/Imap_Client/test/Horde/Imap/test_client.php +++ b/framework/Imap_Client/test/Horde/Imap/test_client.php @@ -22,7 +22,7 @@ */ /** Configuration **/ -$driver = 'Socket'; // 'Socket', 'Cclient', or 'Cclient-pop3' +$driver = 'Socket'; // 'Socket', 'Cclient', or 'Cclient_Pop3' $params = array( 'username' => '', 'password' => '', @@ -104,7 +104,7 @@ if (@require_once 'Benchmark/Timer.php') { $params['id'] = array('name' => 'Horde_Imap_Client test program'); $imap_client = Horde_Imap_Client::getInstance($driver, $params); -if ($driver == 'Cclient-pop3') { +if ($driver == 'Cclient_Pop3') { $test_mbox = $test_mbox_utf8 = 'INBOX'; } @@ -711,7 +711,7 @@ try { print "Fetch: FAILED\n"; // If POP3, try easier fetch criteria - if ($driver == 'Cclient-pop3') { + if ($driver == 'Cclient_Pop3') { try { print_r($imap_client->fetch('INBOX', array( Horde_Imap_Client::FETCH_FULLMSG => array(