From 1fbc471efea69724f0c5addd167322f0326e9520 Mon Sep 17 00:00:00 2001 From: Tem Ogunfiditimi Date: Sat, 12 Dec 2020 23:48:01 -0500 Subject: [PATCH 1/2] Examine error code returned by curl handle instead of return value from curl_exec. Using the return value from curl_exec resulted in failure on new mailboxes that did not contain any mail. Signed-off-by: Tem Ogunfiditimi Changed comparison to identical check Signed-off-by: Tem Ogunfiditmi Signed-off-by: Tem Ogunfiditimi --- lib/IMAP.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/IMAP.php b/lib/IMAP.php index 791d49a..cd5e8ec 100644 --- a/lib/IMAP.php +++ b/lib/IMAP.php @@ -98,9 +98,10 @@ class IMAP extends Base { curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'CAPABILITY'); - $canconnect = curl_exec($ch); + curl_exec($ch); + $errorcode = curl_errno($ch); - if ($canconnect) { + if ($errorcode === 0) { curl_close($ch); $uid = mb_strtolower($uid); $this->storeUser($uid, $groups); From 73a7e4794b2448c2ed00f50cb42a3ff71beb437c Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Tue, 27 Dec 2022 21:33:33 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20update=20changelo?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Sulzer --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 662f6e1..174be79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Fix IMAP authentication on empty mailboxes + [#164](https://github.com/nextcloud/user_external/pull/164) @tem-hth ## [3.0.0] - 2022-04-26 ### Breaking Changes