$imp_imap->ob->login();
return true;
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
IMP::loginLogMessage('failed', __FILE__, __LINE__);
$this->_setAuthError(AUTH_REASON_BADLOGIN);
return false;
$GLOBALS['imp_imap']->ob->append($this->_params['lmailbox'], array(array('data' => $msg)));
return true;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return false;
}
}
$res = $this->_ob->listMailboxes($mbox, array('flat' => true));
return (bool)count($res);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return false;
}
}
$this->_ob = Horde_Imap_Client::getInstance(($protocol == 'imap') ? 'Socket' : 'Cclient-pop3', $imap_config);
return true;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return PEAR::raiseError(_("Cannot connect to the remote mail server: ") . $e->getMessage());
}
}
), array('ids' => $search_res['match']));
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return 0;
}
), array('ids' => array($this->_index)));
$mail_source = $this->_processMailMessage($res[$this->_index]['headertext'][0], $res[$this->_index]['bodytext'][0]);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
continue;
}
if ($this->_params['del']) {
$imp_imap->ob->expunge($mbox, array('ids' => $to_store));
}
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
return $numMsgs;
$notification->push(sprintf(_("The folder \"%s\" was successfully deleted."), IMP::displayFolder($folder)), 'horde.success');
$deleted[] = $folder;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
//$notification->push(sprintf(_("The folder \"%s\" was not deleted. This is what the server said"), IMP::displayFolder($folder)) . ': ' . imap_last_error(), 'horde.error');
}
}
try {
$GLOBALS['imp_imap']->ob->createMailbox($folder);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
//$notification->push(sprintf(_("The folder \"%s\" was not created. This is what the server said"), $display_folder) . ': ' . imap_last_error(), 'horde.error');
return false;
}
$ret = $GLOBALS['imp_imap']->ob->listMailboxes($folder, array('flat' => true));
return !empty($ret);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return false;
}
}
try {
$GLOBALS['imp_imap']->ob->renameMailbox($old, $new);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
//$GLOBALS['notification']->push(sprintf(_("Renaming \"%s\" to \"%s\" failed. This is what the server said"), IMP::displayFolder($old), IMP::displayFolder($new)) . ': ' . imap_last_error(), 'horde.error');
return false;
}
$notification->push(sprintf(_("You were successfully subscribed to \"%s\""), IMP::displayFolder($folder)), 'horde.success');
$subscribed[] = $folder;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
//$notification->push(sprintf(_("You were not subscribed to \"%s\". Here is what the server said"), IMP::displayFolder($folder)) . ': ' . imap_last_error(), 'horde.error');
$return_value = false;
}
$notification->push(sprintf(_("You were successfully unsubscribed from \"%s\""), IMP::displayFolder($folder)), 'horde.success');
$unsubscribed[] = $folder;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
//$notification->push(sprintf(_("You were not unsubscribed from \"%s\". Here is what the server said"), IMP::displayFolder($folder)) . ': ' . imap_last_error(), 'horde.error');
$return_value = false;
}
try {
$status = $GLOBALS['imp_imap']->status($folder, Horde_Imap_Client::STATUS_MESSAGES);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
continue;
}
for ($i = 1; $i <= $status['messages']; ++$i) {
), array('ids' => array($i), 'sequence' => true));
$ptr = reset($res);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
continue;
}
try {
$GLOBALS['imp_imap']->ob->append($mbox, array(array('data' => $message)));
++$msgcount;
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
$message = '';
} else {
try {
$GLOBALS['imp_imap']->ob->append($mbox, array(array('data' => $message)));
++$msgcount;
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
return $msgcount ? $msgcount : false;
protected $_nsdefault;
/**
+ * Constructor.
+ */
+ function __construct()
+ {
+ /* Register the logging callback. */
+ Horde_Imap_Client_Exception::$logCallback = array($this, 'logException');
+ }
+
+ /**
* Save the Horde_Imap_Client object on session shutdown.
*/
function __destruct()
try {
$ob = Horde_Imap_Client::getInstance(($protocol == 'imap') ? 'Socket' : 'Cclient-pop3', $imap_config);
} catch (Horde_Imap_Client_Exception $e) {
- $this->logException($e);
return false;
}
*/
public function logException($e)
{
- // @todo
+ // TODO - Clean this up a bit.
+ Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
}
/**
$this->loadImapObject();
return $GLOBALS['imp_imap']->ob->getNamespaces(!empty($_SESSION['imp']['imap_ext']['namespace']) ? $_SESSION['imp']['imap_ext']['namespace'] : array());
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
// @todo Error handling
return array();
}
} else {
$this->_subscribed = $names;
}
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
return $names;
try {
return $GLOBALS['imp_imap']->ob->status($name, Horde_Imap_Client::STATUS_MESSAGES | Horde_Imap_Client::STATUS_RECENT | Horde_Imap_Client::STATUS_UNSEEN);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return array();
}
}
$ob['limit'] = true;
$ob['by'] = Horde_Imap_Client::SORT_ARRIVAL;
}
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
if (!$ob['limit'] &&
if ($cacheob) {
try {
$preview_info = $cacheob->get($mbox, array_keys($ids), array('IMPpreview', 'IMPpreviewc'));
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
}
if (!is_null($cacheob) && !empty($tostore)) {
$cacheob->set($mbox, $tostore);
}
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
/* Sort via the sorted array index. */
$res = $GLOBALS['imp_imap']->ob->search($this->_mailbox, $query, array('sort' => array($sortpref['by']), 'reverse' => (bool)$sortpref['dir']));
$this->_sorted = $res['sort'];
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
$this->_sorted = array();
}
}
$status_res = $GLOBALS['imp_imap']->ob->status($this->_mailbox, $type == 'recent' ? Horde_Imap_Client::STATUS_RECENT : Horde_Imap_Client::STATUS_UNSEEN);
return $status_res[$type];
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return 0;
}
}
$res = $GLOBALS['imp_imap']->ob->search($this->_mailbox, $criteria, array('results' => $results));
return $count ? $res['count'] : $res['match'];
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return $count ? 0 : array();
}
}
$status = $GLOBALS['imp_imap']->ob->status($this->_mailbox, Horde_Imap_Client::STATUS_MESSAGES);
$ret['anymsg'] = (bool)$status['messages'];
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
$ret['anymsg'] = false;
}
}
try {
$this->_threadob = $GLOBALS['imp_imap']->ob->thread($this->_mailbox);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return new Horde_Imap_Client_Thread();
}
}
$ret = $GLOBALS['imp_imap']->ob->status($this->_mailbox, Horde_Imap_Client::STATUS_MESSAGES | Horde_Imap_Client::STATUS_UIDNEXT | Horde_Imap_Client::STATUS_UIDVALIDITY);
return implode('|', array($ret['messages'], $ret['uidnext'], $ret['uidvalidity'], $sortpref['by'], $sortpref['dir']));
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return '';
}
}
try {
$imp_imap->ob->copy($folder, $targetMbox, array('ids' => $msgIndices, 'move' => $imap_move));
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
//$notification->push(sprintf($message, IMP::displayFolder($folder), IMP::displayFolder($targetMbox)) . ': ' . imap_last_error(), 'horde.error');
$return_value = false;
}
try {
$imp_imap->ob->copy($mbox, $trash, array('ids' => $msgIndices, 'move' => true));
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
// @todo Check for overquota error.
return false;
}
if ($maillog_update) {
try {
$fetch = $imp_imap->ob->fetch($mbox, array(Horde_Imap_Client::FETCH_ENVELOPE => true), array('ids' => $msgIndices));
- } catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
/* Delete the messages. */
if ($expunge_now) {
$this->expungeMailbox($indices_array);
}
- } catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
/* Get the list of Message-IDs deleted, and remove
* the information from the mail log. */
$uid = $GLOBALS['imp_imap']->ob->append($folder, array(array('data' => $res['headertext'][0] . $contents->toString($message, true), 'flags' => $res['flags'], 'messageid' => $res['envelope']['message-id'])));
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return PEAR::raiseError(_("An error occured while attempting to strip the attachment."));
}
try {
$imp_imap->ob->store($mbox, array_merge($action_array, array('ids' => $msgIndices)));
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
$notification->push(sprintf(_("There was an error flagging messages in the folder \"%s\". This is what the server said"), IMP::displayFolder($mbox)) . ': ' . imap_last_error(), 'horde.error');
return false;
}
try {
$imp_imap->ob->store($val, $action_array);
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
return false;
}
}
try {
$imp_imap->ob->expunge($key, array('ids' => is_array($val) ? $val : array()));
$update_list[$key] = $val;
- } catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
return $update_list;
}
$notification->push(sprintf(_("Emptied all messages from %s."), $display_mbox), 'horde.success');
- } catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
}
? sprintf(_("%.2fMB"), $size / (1024 * 1024))
: $size;
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return 0;
}
}
<?php
-
-require_once IMP_BASE . '/lib/Crypt/SMIME.php';
-
/**
* The IMP_Horde_Mime_Viewer_pkcs7 class allows viewing/decrypting of S/MIME
* messages.
$quota_val = reset($quota);
return array('usage' => $quota['storage']['usage'] * 1024, 'limit' => $quota['storage']['limit'] * 1024);
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return PEAR::raiseError(_("Unable to retrieve quota"), 'horde.error');
}
}
foreach ($results['sort'] as $val2) {
$sorted[] = $val2 . IMP::IDX_SEP . $val;
}
- } catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
- }
+ } catch (Horde_Imap_Client_Exception $e) {}
}
return $sorted;
$results = $GLOBALS['imp_imap']->ob->search($mailbox, $query, array('reverse' => $sortdir, 'sort' => array($sortby)));
return $results['sort'];
} catch (Horde_Imap_Client_Exception $e) {
- $GLOBALS['imp_imap']->logException($e);
return array();
}
}
Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => $readonly))
), array('ids' => array($index)));
} catch (Horde_Imap_Client_Exception $e) {
- $imp_imap->logException($e);
require IMP_BASE . '/mailbox.php';
exit;
}