ruby - Using IMAP, how do I get the latest messages? -


i new imap protocol , wondering how can pull latest n messages?

i have started things like:

imap.search([1..10]).each |message_id| ... end 

and fetching directly number array given 1..10. returns ten oldest messages in mailbox.

how can retrieve ten newest instead?

read protocol specification, rfc 3501. there no way understand imap without doing this.


Comments