node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Search based on uid range and date range

Open govindaraja91 opened this issue 5 years ago • 1 comments

Hi,

I'm trying to search uids based on UID range and date range, is it possible to search?, i have following criteria, which results to Incorrect number of arguments for search option: UID

search criteria looks like : [ 'UID', '5912:5921', [ 'SINCE', 'January 01, 2020' ] ].

please help me to solve this.

govindaraja91 avatar Jun 25 '20 06:06 govindaraja91

This is what you should be passing to .search() for the criteria argument in that case:

[ ['UID', '5912:5921'], [ 'SINCE', 'January 01, 2020' ] ]

Only search criteria types that do not take arguments can be placed without a subarray. For example, if you wanted new messages since January 1, 2020:

[ 'UNSEEN', [ 'SINCE', 'January 01, 2020' ] ]

mscdex avatar Jun 25 '20 11:06 mscdex