
That's right, you can pull all of your email users into E.F.A. and authenticate against AD (probably any LDAP server)!
I plan on making this a configuration option in a later release of E.F.A.
For now, follow these steps.
1) Create a user and password (proxy service account) in AD to allow username lookups
2) Configure Mailwatch
Edit /var/www/html/mailscanner/conf.php
Code: Select all
// LDAP settings
define('USE_LDAP', '1');
define('LDAP_HOST', 'server.example.com');
define('LDAP_PORT', '389');
define('LDAP_DN', 'DC=example,DC=com');
define('LDAP_USER', 'LDAPProxy@example.com');
define('LDAP_PASS', 'secret');
define('LDAP_SITE', 'default-first-site-name');
The following lines are needed in functions.php for this situation
Before this line (near line 2236 in function ldap_authenticate)
ldap_bind ($ds, LDAP_USER, LDAP_PASS);
Insert the following two lines immediately BEFORE:
Code: Select all
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
Edit this line from:
$r = ldap_search ($ds, LDAP_DN, "proxyaddresses=SMTP:$USER") or die ("Could not search");
and these lines:
if (isset ($result[0]['proxyaddresses'])) {
foreach ($result[0]['proxyaddresses'] as $email) {
to:
Code: Select all
$r = ldap_search ($ds, LDAP_DN, "mail=$USER") or die ("Could not search");
Code: Select all
if (isset ($result[0]['mail'])) {
foreach ($result[0]['mail'] as $email) {
Code: Select all
yum install php-ldap