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

fix assumedNextTaggedLine bug #288

Merged
merged 1 commit into from
Oct 17, 2022
Merged

fix assumedNextTaggedLine bug #288

merged 1 commit into from
Oct 17, 2022

Conversation

Blear
Copy link
Contributor

@Blear Blear commented Sep 27, 2022

fix assumedNextTaggedLine bug
The session expiration error returned by the done command is not captured correctly, resulting in laravel command mode not receiving new emails after some time.

fix assumedNextTaggedLine bug
@Blear Blear changed the title Update ImapProtocol.php fix assumedNextTaggedLine bug Sep 27, 2022
@Blear
Copy link
Contributor Author

Blear commented Sep 27, 2022

>> TAG322 IDLE
<< + idling
>> DONE
<< TAG322 OK IDLE terminated (Success)
>> TAG323 IDLE
<< + idling
>> DONE
<< * BYE Session expired, please login again.  (Unable to catch this error)
public function done(): bool {
  $this->write("DONE");
  if (!$this->assumedNextTaggedLine('OK', $tags)) {
      throw new RuntimeException('done failed');
  }
  return true;
}
protected function assumedNextTaggedLine(string $start, &$tag): bool {
  $line = $this->nextTaggedLine($tag);
  return strpos($line, $start) >= 0;//strpos($line, $start) !==false
}

@Webklex
Copy link
Owner

Webklex commented Oct 17, 2022

Hi @Blear ,
thank you! :)

Best regards,

@Webklex Webklex merged commit 68eaf30 into Webklex:master Oct 17, 2022
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.

2 participants