diff --git a/www/baikal/Makefile b/www/baikal/Makefile index 6aac558a00bb..cd3c25815af5 100644 --- a/www/baikal/Makefile +++ b/www/baikal/Makefile @@ -3,7 +3,7 @@ PORTNAME= baikal PORTVERSION= 0.4.6 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www MASTER_SITES= https://github.com/fruux/Baikal/releases/download/${PORTVERSION}/ @@ -14,7 +14,8 @@ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE USES= php zip -USE_PHP= ctype dom filter json mbstring openssl pdo_sqlite session xml xmlreader xmlwriter +USE_PHP= ctype dom filter imap json mbstring openssl pdo_sqlite \ + session xml xmlreader xmlwriter WRKSRC= ${WRKDIR}/${PORTNAME} NO_BUILD= yes diff --git a/www/baikal/files/patch-vendor_sabre_dav_lib_DAV_Auth_Backend_IMAP.php b/www/baikal/files/patch-vendor_sabre_dav_lib_DAV_Auth_Backend_IMAP.php new file mode 100644 index 000000000000..84c399b4795f --- /dev/null +++ b/www/baikal/files/patch-vendor_sabre_dav_lib_DAV_Auth_Backend_IMAP.php @@ -0,0 +1,82 @@ +--- /dev/null 12:27:00 UTC ++++ vendor/sabre/dav/lib/DAV/Auth/Backend/IMAP.php +@@ -0,0 +1,79 @@ ++mailbox = $mailbox; ++ ++ } ++ ++ /** ++ * Connects to an IMAP server and tries to authenticate ++ * ++ * @param string $username ++ * @param string $password ++ * @return bool ++ */ ++ protected function imapOpen($username, $password) { ++ ++ $success = false; ++ ++ try { ++ $imap = imap_open($this->mailbox, $username, $password, OP_HALFOPEN | OP_READONLY, 1); ++ if ($imap) ++ $success = true; ++ } catch (\ErrorException $e) { ++ error_log($e->getMessage()); ++ } ++ ++ $errors = imap_errors(); ++ if ($errors) ++ foreach ($errors as $error) ++ error_log($error); ++ ++ if (isset($imap) && $imap) ++ imap_close($imap); ++ ++ return $success; ++ ++ } ++ ++ /** ++ * Validates a username and password by trying to authenticate against IMAP ++ * ++ * @param string $username ++ * @param string $password ++ * @return bool ++ */ ++ protected function validateUserPass($username, $password) { ++ ++ return $this->imapOpen($username, $password); ++ ++ } ++ ++} diff --git a/www/baikal/pkg-plist b/www/baikal/pkg-plist index 54d50c61e4bf..e7762828182c 100644 --- a/www/baikal/pkg-plist +++ b/www/baikal/pkg-plist @@ -376,6 +376,7 @@ %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Backend/BackendInterface.php %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Backend/BasicCallBack.php %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Backend/File.php +%%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Backend/IMAP.php %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Backend/PDO.php %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Auth/Plugin.php %%WWWDIR%%/vendor/sabre/dav/lib/DAV/Browser/GuessContentType.php