-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
leaveUnread() does not work if an exception happens during fetching #507
Comments
It looks like messages are marked as "unread" here: https://github.com/Webklex/php-imap/blob/master/src/Message.php#L300 |
Here is the fix for Query->populate() function https://github.com/Webklex/php-imap/blob/master/src/Query/Query.php#L339C24-L339C32:
It's quite an important thing as if someone fetches only unread emails (like us) and an exception happens for some email in a bunch all other emails will stay marked as "unread" and will be unprocessed. |
And here is the fix allowing to leave emails unread even if "Allowed memory size exhausted" fatal error occurs: |
One user reported an issue freescout-help-desk/freescout#4159.
If an error occurs during fetching the email in the mailbox stays "read" even though
leaveUnread()
is set.Here is the example of headers which can be used to reproduce the issue:
We've found out that the following line marks an email as "read": https://github.com/Webklex/php-imap/blob/master/src/Query/Query.php#L246
So apparently somewhere in the code there should a place marking an email as "unread" if
leaveUnread()
is set.Is it so? If yes, can someone help to find that place in order to try to find a solution.
The text was updated successfully, but these errors were encountered: