Skip to content

"Empty response" when an empty folder is scanned #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rskrzypczak opened this issue Jun 10, 2024 · 0 comments
Open

"Empty response" when an empty folder is scanned #499

rskrzypczak opened this issue Jun 10, 2024 · 0 comments

Comments

@rskrzypczak
Copy link
Contributor

Describe the bug
When I try to use getByUidGreater() or similar on a folder that is empty and does not contain any email messages, I get an error.

Code to Reproduce
$limit = 10;
$uid = 0;
$name = 'INBOX.Archive';
$folder = $this->client->getFolderByPath($name);
$folder->query()->limit($limit)->getByUidGreater($uid);

Webklex\\PHPIMAP\\Exceptions\\ResponseException: Command failed to process:
Causes:
	- Empty response
Error occurred in vendor/webklex/php-imap/src/Exceptions/ResponseException.php:53
Stack trace:
#0 vendor/webklex/php-imap/src/Connection/Protocols/Response.php(318): Webklex\\PHPIMAP\\Exceptions\\ResponseException::make()
#1 vendor/webklex/php-imap/src/Connection/Protocols/Response.php(308): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validate()
#2 vendor/webklex/php-imap/src/Query/Query.php(525): Webklex\\PHPIMAP\\Connection\\Protocols\\Response->validatedData()
#3 vendor/webklex/php-imap/src/Query/Query.php(573): Webklex\\PHPIMAP\\Query\\Query->filter()
#4 app/Mail/Connections/Imap.php(163): Webklex\\PHPIMAP\\Query\\Query->getByUidGreater()

Expected behavior
This exception should not occur

Desktop / Server (please complete the following information):

  • OS: [e.g. Debian 11]
  • PHP: [e.g. 8.3]
  • Version [e.g. v5.5.0]
pierement pushed a commit to pierement/php-imap that referenced this issue Apr 16, 2025
Webklex pushed a commit that referenced this issue Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant