From 610036138a85c83a4fa9a838b52a3f452e111035 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" Date: Wed, 11 Sep 2013 16:31:19 +0100 Subject: [PATCH] Add the possibility to set the a mailhost attribute value to be used as the IMAP server address to connect to. --- plugins/kolab_auth/kolab_auth.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php index 13d4e865..b8c5996b 100644 --- a/plugins/kolab_auth/kolab_auth.php +++ b/plugins/kolab_auth/kolab_auth.php @@ -326,11 +326,21 @@ class kolab_auth extends rcube_plugin $email_attr = $rcmail->config->get('kolab_auth_email'); $org_attr = $rcmail->config->get('kolab_auth_organization'); $role_attr = $rcmail->config->get('kolab_auth_role'); + $imap_attr = $rcmail->config->get('kolab_auth_mailhost'); if (!empty($role_attr) && !empty($record[$role_attr])) { $_SESSION['user_roledns'] = (array)($record[$role_attr]); } + if (!empty($imap_attr) && !empty($record[$role_attr])) { + $default_host = $rcmail->config->get('default_host'); + if (!empty($default_host)) { + rcube::write_log("errors", "Both default host and kolab_auth_mailhost set. Incompatible."); + } else { + $args['host'] = "tls://" . $record[$role_attr]; + } + } + // Login As... if (!empty($loginas) && $admin_login) { // Authenticate to LDAP