mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.17k stars 382 forks source link

Is there a way to search emails based on a specific domain address in "FROM"? #805

Open suryamishraXO opened 4 years ago

suryamishraXO commented 4 years ago

Can I search for messages being sent from a specific domain rather that a full email address, with an asterisk maybe?

So, let's say, there are 3 senders abc@gmail.com, def@gmail.com, ghi@gmail.com. Now, I want to search for the emails having these addresses as their sender.

For eg;imap.search(['FROM','*@gmail.com'], function (err, results) {

NOTE: don't want to go with OR and FROM combination as there could be around hundreds of email addresses belonging to a domain.