UIDVALIDITY of mailbox has changed.
[mms] Simplify forwarding - always attach entire message.
[mms] Remember splitbar position on login/refresh (DIMP).
-[mms] Disable some advanced functions if using POP3 driver (caching,
- searching, sorting) because it is too resource intensive.
+[mms] Disable advanced functions if using POP3 driver (caching, on-demand
+ filtering, searching, sorting) because it is too resource intensive.
[mms] Use native PHP code for POP3 driver (c-client no longer required).
[mms] All native IMP code now uses exceptions instead of PEAR_Errors.
[mms] Fix wrong charset on filenames when stripping attachments (Bug #7220).
The selected IMAP server MUST support IMAP4rev1 (RFC 3501).
The selected POP server MUST support POP3 (RFC 1939/STD 53).
+ .. If using a POP server, caching, on-demand filtering, searching, and
+ sorting are disabled.
+ POP3 support is limited essentially to only viewing messages.
+ An IMAP server is REQUIRED for all other advanced features.
+
The following items are not required, but are strongly **RECOMMENDED**:
1. Sendmail or equivalent.
return false;
}
- $protocol = isset($server['protocol']) ? strtolower($server['protocol']) : 'imap';
+ $protocol = isset($server['protocol'])
+ ? strtolower($server['protocol'])
+ : 'imap';
$imap_config = array(
'debug' => isset($server['debug']) ? $server['debug'] : null,
$_services['server'] = array(
'args' => array(),
- 'type' => 'string'
+ 'type' => '{urn:horde}hashHash'
);
$_services['favouriteRecipients'] = array(
}
/**
- * Returns the currently logged on IMAP server.
- *
- * @return string The server hostname. Returns null if the user has not
- * authenticated into IMP yet.
+ * Returns information on the currently logged on IMAP server.
+ *
+ * @return mixed Returns null if the user has not authenticated into IMP yet.
+ * Otherwise, an array with the following entries:
+ * <pre>
+ * 'hostspec' - (string) The server hostname.
+ * 'port' - (integer) The server port.
+ * 'protocol' - (string) Either 'imap' or 'pop'.
+ * </pre>
*/
function _imp_server()
{
if (IMP::checkAuthentication(true)) {
$imap_obj = unserialize($_SESSION['imp']['imap_ob']);
- return $imap_obj->getParam('hostspec');
- } else {
- return null;
+ return array(
+ 'hostspec' => $imap_obj->getParam('hostspec'),
+ 'port' => $imap_obj->getParam('hostspec'),
+ 'protocol' => $_SESSION['imp']['protocol']
+ );
}
+
+ return null;
}
/**
*
* script: (string) The type of Ingo_Script driver this server uses.
* Valid options:
- * 'imap' - IMAP client side filtering
+ * 'imap' - IMAP client side filtering (POP3 servers NOT
+ supported)
* 'maildrop' - Maildrop scripts
* 'procmail' - Procmail scripts
* 'sieve' - Sieve scripts
*/
public function canApply()
{
- return $this->performAvailable() &&
- $GLOBALS['registry']->hasMethod('mail/server');
+ if ($this->performAvailable() &&
+ $GLOBALS['registry']->hasMethod('mail/server')) {
+ $server = $GLOBALS['registry']->call('mail/server');
+ return ($server['protocol'] == 'imap');
+ }
+
+ return false;
}
/**
*/
public function apply()
{
- if ($this->canApply()) {
- return $this->perform(array('mailbox' => 'INBOX'));
- }
-
- return false;
+ return $this->canApply()
+ ? $this->perform(array('mailbox' => 'INBOX'))
+ : false;
}
}