* 1939) via the PHP imap (c-client) module. This driver is an abstraction
* layer allowing POP3 commands to be used based on its IMAP equivalents.
*
+ * Caching is not supported in this driver.
+ *
* PHP IMAP module: http://www.php.net/imap
*
* No additional paramaters from those defined in Horde_Imap_Client_Cclient.
public function __construct($params)
{
$this->_service = 'pop3';
- if (!isset($params['port'])) {
+ if (empty($params['port'])) {
$params['port'] = ($params['secure'] == 'ssl') ? 995 : 110;
}
+
parent::__construct($params);
+
+ // Disable caching.
+ $this->_params['cache'] = array('fields' => array());
}
/**
*/
protected function _capability()
{
- throw new Horde_Imap_Client_Exception('IMAP CAPABILITY command not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED);
+ throw new Horde_Imap_Client_Exception('CAPABILITY command not supported in this POP3 driver.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED);
}
/**
*/
protected function _store($options)
{
- throw new Horde_Imap_Client_Exception('Flagging messages not supported on POP3 servers.', Horde_Imap_Client_Exception::POP3_NOTSUPPORTED);
+ /* Only support deleting/undeleting messages. */
+ if (isset($options['replace'])) {
+ if (count(array_intersect($options['replace'], array('\\deleted')))) {
+ $options['add'] = array('\\deleted');
+ } else {
+ $options['remove'] = array('\\deleted');
+ }
+ unset($options['replace']);
+ } else {
+ if (!empty($options['add']) &&
+ count(array_intersect($options['add'], array('\\deleted')))) {
+ $options['add'] = array('\\deleted');
+ }
+
+ if (!empty($options['remove']) &&
+ !count(array_intersect($options['remove'], array('\\deleted')))) {
+ $options['add'] = array();
+ $options['remove'] = array('\\deleted');
+ }
+ }
+
+ return parent::_store($options);
}
/**