IMAP authentication

Download the latest version of mod_auth_imap:

cd /extra/src
tar zxf mod_auth_imap2-current.tar.gz
cd mod_auth_imap2-2.2.0

If you use Dovecot, you'll need apply a patch:

patch < ../dovecot_mod_auth_imap.patch

Use Apache's apsx program to build the module. if you have previously installed mod_auth_imap, don't use the "-a" flag to APXS, as you already have the necessary changes in httpd.conf.

/usr/local/apache2/bin/apxs -i -a -c mod_auth_imap.c

Restart Apache

svc -t /service/apache

Virtualhost configuration

<Directory /home/httpd/html>
  #Turn on IMAP Authentication
  Auth_IMAP_Enabled on

  #Give a name to the authentication domain, whatever you want:
  AuthName ""

  #Only basic authentication is supported for now:
  AuthType Basic

  #If you feel like it, restrict the users or allow all "valid-user"
  Require user user1 user2

  #Make IMAP Authentication authoritative for this .htaccess file:
  Auth_IMAP_Authoritative on

  #Set the IMAP Server to which you want to connect (default=localhost):

  #Set the port on which the imap server is running (default=143):
  Auth_IMAP_Port 143

  #Turn on some extra logging (login attempts, etc.) in Apache's Error Log
  Auth_IMAP_Log on

Add support for Dovecot to mod_auth_imap2

File dovecot_mod_auth_imap.patch738 bytes

Recent Updates

  • 2 years 1 month ago
  • 2 years 1 month ago
  • 2 years 1 month ago
    php 8.x
  • 2 years 1 month ago
  • 2 years 1 month ago
    Drop Centos 5/6 stuff