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

How to $mailbox->getMessages() higher than UID x? #517

Closed
benediktcarda opened this issue Aug 27, 2021 · 1 comment
Closed

How to $mailbox->getMessages() higher than UID x? #517

benediktcarda opened this issue Aug 27, 2021 · 1 comment

Comments

@benediktcarda
Copy link

benediktcarda commented Aug 27, 2021

The industry standard of an IMAP client checking mail is to:
-> save the uidvalidity of a mailbox
-> save the highest UID fetched from this mailbox

Then, next time you fetch emails, check whether uidvalidity is unchanged and if yes, request to get all messages with a higher UID than what you saved as the highest UID you already have. (If uidvalidity changed fetch all messages again.) This makes sure you will not miss out on messages.

Anyway, I can't find a way how I can do a $mailbox->getMessages() with UID as search criteria.
Can somebody help me?

@benediktcarda
Copy link
Author

Ok, I found out, that there is a seperate function to perform search by UID:
$mailbox->getMessageSequence('13900:*');

It would be good to add this to the README.MD as this is probably a very common use case.

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

No branches or pull requests

1 participant