Configuration/hooks/Authentication/IMAP

From Davical
Revision as of 02:07, 2 January 2016 by Fsfs (talk | contribs) (delete "known problem" fixed in 1.1.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Template:Languages

Last updated for the 1.0.2 release.

Documentation for the IMAP authentication driver (inc/drivers_imap_pam.php).

This driver allows DAViCal to accept authentication via a local or remote IMAP server.

PHP IMAP is required as an extra dependency. Install php5-imap on Debian/Ubuntu based systems.

IMAP Settings

The settings for the IMAP server connection go in the config file /etc/davical/<servername>-conf.php (this file might be in /etc/rscds/ if you upgraded from an older installation).

  $c->authenticate_hook['call'] = 'IMAP_PAM_check';
  $c->authenticate_hook['config'] = array(
      'imap_url'   => '{<IMAP SERVER>}',
      'email_base' => '<EMAIL DOMAIN HOST>'
    );
  include('drivers_imap_pam.php');

imap_url is required. IMAP SERVER must be an IMAP URL surrounded by curly brackets as documented in the PHP manual. Some common examples are provided below:

{localhost:143/imap/}                      // Insecure on local server
{localhost:143/imap/tls/}                  // START TLS to a local server
{example.com:993/imap/ssl/}                // Legacy SSL on deprecated port
{example.com:143/imap/tls/novalidate-cert} // Self-signed certificate

Note that authenticating to an external server over TLS/SSL is slow. The connection to the IMAP server will not request a working mailbox and the server response should thus not be too slow.

Providing an hostname/mailname (example.com) through the email_base parameter is optional.

Example

The following config example allows DAViCal to authenticate users via a secure IMAP server at example.com:

<?php
  $c->authenticate_hook['call'] = 'IMAP_PAM_check';
  $c->authenticate_hook['config'] = array(
      'imap_url'   => '{example.com:143/imap/tls/}',
      'email_base' => 'example.com'
    );
  include('drivers_imap_pam.php');