postalsys / imapflow

IMAP Client library for EmailEngine Email API (https://emailengine.app)
https://imapflow.com
Other
364 stars 63 forks source link

Flexible SequenceString's #175

Closed ArgtimZ closed 7 months ago

ArgtimZ commented 7 months ago

The current SequenceString's aren't really flexible. What do I mean?

Try to fetch the newest 50 e-mails for example. Without calculating at what email position number you should start this is not doable. Would love to see a solution like "*:50" (=go from newest e-mail untill the 50th newest e-mail).

Why does this matter? Imagine you have 800 e-mails. Fetching them all and then just take the last 50 mails from it, is not efficent at all.

So if there isn't any other way to do it, that I clearly don't know about, I would appreciate it if you add this feature to Imapflow.

andris9 commented 7 months ago

Sequence string usage is defined by the IMAP standard. "*" is the placeholder for the newest email (also defined by the standard). If you want the last 50 emails from a folder of 800 emails just use "751:800" as the sequence string.