-
Notifications
You must be signed in to change notification settings - Fork 32
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
Message getting lost during iteration of mailbox if message moved #34
Comments
** UPDATE ** If I use imap2_mail_copy() followed by imap2_delete() INSTEAD of imap2_mail_move() it works as expected. Cheers |
|
great - well spotted. so for now I have a workaround but will it be fixed in new release? |
Afaik this is not really a bug rather a lucky surprise that it works with the imap_ lib. Instead of using imap(2)_headerinfo which only works with msgno you should use e.g. $hdr = imap2_rfc822_parse_headers(imap2_fetchheader()) and work with message IDs as those don't change. To get a list of all UIDs you could use e.g. imap2_fetch_overview |
I guess you could simply replace the client->move call in Mail class by client->copy and add the expunge flag afterwards.. |
Please see example code below. I have found that I'm losing messages in the loop if the message is moved to a subfolder during processing.
For example, let's say I have 3 messages to process.
After message 1 is processed and moved to a subfolder then message 3 becomes the second message to be processed and message 2 is lost. This used to work fine before moving to php-imap2 functions.
After processing message 2 will still be in the INBOX folder - its just not being picked up in the loop.
The text was updated successfully, but these errors were encountered: