Commit 666087e0 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #680 in ZP/z-push from bugfix/ZP-1391-imap-disable-gssapi to develop

* commit 'ed406f1e':
  ZP-1391 Support disabling multiple IMAP auth methods, log the disabled methods. Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-1391 Allow disabling the GSSAPI authenticator. Released under the Affero GNU General Public License (AGPL) version 3.
parents 9b8e68e3 ed406f1e
......@@ -207,4 +207,9 @@ define('SYSTEM_MIME_TYPES_MAPPING', '/etc/mime.types');
// Use BackendCalDAV for Meetings. You cannot hope to get that functionality working without a caldav backend.
define('IMAP_MEETING_USE_CALDAV', false);
\ No newline at end of file
define('IMAP_MEETING_USE_CALDAV', false);
// If your IMAP server allows authenticating via GSSAPI, php-imap will not fall back properly to other authentication
// methods and you will be unable to log in. Uncomment the following line to disable that authentication method.
// Multiple methods can be specified as a comma-separated string.
// define('IMAP_DISABLE_AUTHENTICATOR', 'GSSAPI');
......@@ -52,6 +52,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
private $folderhierarchy;
private $excludedFolders;
private static $mimeTypes = false;
private $imapParams = array();
public function __construct() {
......@@ -68,6 +69,10 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
if (!function_exists("mb_detect_order")) {
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP(): php-mbstring module is not installed, you should install it for better encoding conversions"));
}
if (defined("IMAP_DISABLE_AUTHENTICATOR")) {
ZLog::Write(LOGLEVEL_INFO, sprintf("BackendIMAP(): The following authentication methods are disabled: %s", IMAP_DISABLE_AUTHENTICATOR));
$this->imapParams = array("DISABLE_AUTHENTICATOR" => array_map('trim' ,explode(',', IMAP_DISABLE_AUTHENTICATOR)));
}
}
/**----------------------------------------------------------------------------------------------------------
......@@ -105,7 +110,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
/* END fmbiete's contribution r1527, ZP-319 */
// open the IMAP-mailbox
$this->mbox = @imap_open($this->server , $username, $password, OP_HALFOPEN);
$this->mbox = @imap_open($this->server , $username, $password, OP_HALFOPEN, 0, $this->imapParams);
$this->mboxFolder = "";
if ($this->mbox) {
......@@ -2224,7 +2229,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
imap_ping($this->mbox);
}
else {
$this->mbox = @imap_open($this->server, $this->username, $this->password, OP_HALFOPEN);
$this->mbox = @imap_open($this->server, $this->username, $this->password, OP_HALFOPEN, 0, $this->imapParams);
$this->mboxFolder = "";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment