From 1a0a86e73257c22d537f20df0e8b32b8a6760974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bou=C4=8Dek?= Date: Mon, 5 Sep 2022 14:47:17 +0200 Subject: [PATCH] Fix: Prevent restore cache on closing connection (#548) --- src/Connection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Connection.php b/src/Connection.php index d562ab6a..538080e9 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -50,9 +50,11 @@ public function expunge(): bool public function close(int $flag = 0): bool { + $stream = $this->resource->getStream(); + $this->resource->clearLastMailboxUsedCache(); - return \imap_close($this->resource->getStream(), $flag); + return \imap_close($stream, $flag); } public function getQuota(string $root = 'INBOX'): array