Skip to content

move method is moving the wrong message #105

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

Closed
EthraZa opened this issue Feb 12, 2021 · 5 comments
Closed

move method is moving the wrong message #105

EthraZa opened this issue Feb 12, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@EthraZa
Copy link

EthraZa commented Feb 12, 2021

$messageA->move($new_folder); // Moves msg ID 1
$messageB->move($new_folder); // Try to move msg ID 2 and fails

Why:
At least in Gmail, for some reason I was unable to pinpoint yet, PHP-IMAP is using MID (message number/ID) instead of UID (Unique ID). So, when we move the msg ID 1 the second message becomes the 1, so it fails to move ID 2 because it does not exist anymore.

Question:
Am I missing some setup to get it using UID instead of MID?

@Webklex
Copy link
Owner

Webklex commented Feb 17, 2021

Hi @EthraZa ,
thanks for your report.

You can switch to UID by setting options.sequence from \Webklex\PHPIMAP\IMAP::ST_MSGN to \Webklex\PHPIMAP\IMAP::ST_UID.

I highly recommend to do so :)

Best regards,

@EthraZa
Copy link
Author

EthraZa commented Feb 17, 2021

How on earth did I miss that? Gonna check it.
But buddy, why make ST_MSGN the default?

@Webklex
Copy link
Owner

Webklex commented Feb 17, 2021

Well, that's historic - If I change it now, it might break other peoples code... so I've never changed it...

You don't happen to have any good update strategy?

Best regards,

@EthraZa
Copy link
Author

EthraZa commented Feb 17, 2021

If it can break other people code it's not good to change.
Maybe make it available on the Getting started doc examples will suffice to make sure people notice the option exists and what is the default.
Also it will show how to use the advanced options since the docs does not let it clear if it goes in the same level as the other options or go inside an options array as it is inside the imap.php.

@Webklex Webklex added the enhancement New feature or request label Feb 24, 2021
@Webklex
Copy link
Owner

Webklex commented Nov 3, 2021

Hi @EthraZa,
with the next release IMAP::ST_MSGN won't be the default anymore.

Thanks for raising the issue!

Best regards,

@Webklex Webklex closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants