Skip to content
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

Ignore possible untagged lines after IDLE and DONE commands #331

Closed
wants to merge 0 commits into from

Conversation

gazben
Copy link

@gazben gazben commented Nov 16, 2022

Hi,

If you use mailbox.org as the imap server and you get a lot of emails to the inbox the server can send an untagged response after the DONE or IDLE commands and the function will fail.

Example:

>> DONE
<< * 1 RECENT
<< TAG18 OK Idle completed (0.591 + 0.590 + 0.590 secs).

I propose to ignore the untagged status updates from the server after the DONE and IDLE commands.
@Webklex What do you think of this solution?

@adrienbrault
Copy link
Contributor

Thank you for the patch, it fixes the issue I was getting:

>> TAG4 IDLE
<< + idling


<< * 4 FETCH (FLAGS ())
>> DONE
<< TAG4 OK Idle completed (38.853 + 38.853 + 38.852 secs).
>> TAG5 IDLE
<< + idling
<< * 4 FETCH (FLAGS (\Seen))
>> DONE
<< TAG5 OK Idle completed (17.763 + 17.763 + 17.762 secs).
>> TAG6 IDLE
<< + idling

<< * 5 EXISTS
>> DONE
<< * 1 RECENT
>> DONE
<< TAG6 OK Idle completed (30.118 + 30.014 + 30.117 secs).
>> TAG7 IDLE
<< DONE BAD Error in IMAP command: Invalid command name (0.001 + 0.000 secs).

In ImapProtocol.php line 1063:

  [Webklex\PHPIMAP\Exceptions\RuntimeException]
  idle failed


Exception trace:
  at /application/vendor/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php:1063
 Webklex\PHPIMAP\Connection\Protocols\ImapProtocol->idle() at /application/vendor/webklex/php-imap/src/Folder.php:406

Here's the commit rebased on the latest master with conflicts fixed: adrienbrault@b7f669e

@gazben
Copy link
Author

gazben commented Oct 3, 2023

I guess this PR is now obsolete. I'll see what I can do with the current version

@gazben
Copy link
Author

gazben commented Oct 3, 2023

@adrienbrault Did you upgrade to the 5.0 version?

@adrienbrault
Copy link
Contributor

I am no longer using imap/this lib

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

Successfully merging this pull request may close these issues.

None yet

2 participants