<configtab name="hooks" desc="Custom Hooks">
<configsection name="hooks">
- <configboolean name="vinfo" required="false" desc="Should we use a custom
- virtual users hook? If so, make sure you define _imp_hook_vinfo() in
- hooks.php. The hook will be used to set $_SESSION['imp']['user'] at login
- time. There are examples in hooks.php.dist.">false</configboolean>
<configboolean name="postsent" required="false" desc="Should we
run a custom function after sending a message? If so, make sure you define
_imp_hook_postsent() in hooks.php. The hook will be used to do anything
// }
// }
-// Here is an example _imp_hook_vinfo function.
-//
-// If $type == 'username', this function returns a unique username composed of
-// username + vdomain. $data is set to the username.
-//
-// If $type == 'vdomain', this function returns the HTTP_HOST variable after
-// removing the 'mail.' subdomain. $data is null.
-//
-// ex. $HTTP_HOST = 'mail.mydomain.com', $username = 'myname':
-// $vdomain = 'mydomain.com'
-// $username = 'myname_mydomain_com'
-//
-// Throw a Horde_Exception object on failure.
-
-// if (!function_exists('_imp_hook_vinfo')) {
-// function _imp_hook_vinfo($type = 'username', $data = null)
-// {
-// $vdomain = Horde_String::lower(preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')));
-//
-// switch ($type) {
-// case 'username':
-// return preg_replace('|\.|', '_', $data . '_' . $vdomain);
-//
-// case 'vdomain':
-// return $vdomain;
-//
-// default:
-// throw new Horde_Exception('invalid type: ' . $type);
-// }
-// }
-// }
-
// Here is an example of the _imp_hook_fetchmail_filter function to run
// SpamAssassin on email before it is written to the mailbox.
// Note: to use the spamassassin instead of spamd, change 'spamc' to
TODO
----
* servers.php has changed
-* imp_hook_vinfo has changed
+* imp_hook_vinfo has been removed - use preauth hook instead
* alternative_display, attachment_display, forward_default pref is gone.
* imp_hook_spam_bounce -> imp_hook_spam_email
* imp_hook_msglist_format hook has been removed - instead:
'showunsub' => false
);
- /* Run the username through virtualhost expansion functions if
- * necessary. */
- if (!empty($conf['hooks']['vinfo'])) {
- try {
- $credentials['userId'] = Horde::callHook('_imp_hook_vinfo', array('username', $credentials['userId']), 'imp');
- } catch (Horde_Exception $e) {}
- }
-
/* Load the server configuration. */
$ptr = $GLOBALS['imp_imap']->loadServerConfig($credentials['server']);
if ($ptr === false) {