emailjs / emailjs-imap-client

Low-level JS IMAP client for all your IMAP needs.
MIT License
552 stars 123 forks source link

Feature: Search for multiple HEADER fields (AND) #257

Open mfodor opened 2 years ago

mfodor commented 2 years ago

Currently, one HEADER search criteria can be passed to the search command only. To be more precise: can add more but only in OR or NOT fields so there is no option to add multiple with AND relation.

I could workaround it with passing search object like the following:

{
  header: ['subject', 'To search for this'],
  Header: ['from', 'from@address'],
  hEader: ['to', 'to@address']
}

But this is not a nice solution. I've tried to pass header: ['subject', 'To search for this', 'HEADER', 'from', 'from@address'] but that's results in invalid command since 'HEADER' will be added as String not as atom.

I know about #212 but I wanted to report this. Who knows, maybe I'll have time to create a PR as well.