node-imap
node-imap copied to clipboard
Search based on uid range and date range
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.
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' ] ]