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

Can`t fetch emails by FROM array criteria

Open eq4l opened this issue 8 years ago • 3 comments

Hello, how I can sort email by FROM criteria? Tried to use imap.search(["ALL", ["FROM", "[email protected]"]], function(err, arr) { // some stuff } And got error Unsupported search criterion: FROM

Tried to use imap.search([['FROM', '[email protected]']], function(err, results) { // some stuff } got error
throw new Error('Nothing to fetch');

also tried to use HEADER and got the same error.

How to use it correctly?

eq4l avatar Dec 11 '17 12:12 eq4l

Hello, I debugged this issue and You should use a phrase like this: imap.search([['FROM','[email protected]']], function (err, results) {

But ... if you add special char '+', it occurs problem for instance: imap.search([['FROM','[email protected]']], function (err, results) { throw new Error('Nothing to fetch');

MaciejKadewski avatar Jan 07 '18 21:01 MaciejKadewski

Is there a way to search emails based on a specific domain address in "FROM"? (With an asterisk, maybe) For eg; imap.search([['FROM','*@gmail.com']], function (err, results) {

suryamishraXO avatar Apr 16 '20 07:04 suryamishraXO

hello, I'm facing the same problem, even years after this open issue, is there any query parameter to filter senders better? or even if there is already an option to search for emails that contain the '+'?

cristianofmc avatar Jul 28 '22 02:07 cristianofmc