Provide search criteria to IMAP on email node on trigger

The node-red-node-email allows an e-mail fetch to be triggered. But the search criteria are limited to just a few including "Seen", "Unseen", "All".

It would be great to be able to pass the criteria directly when triggering as described in the underlying imap-node:

Like this, it would be possible to fetch all messages in the References header on an already fetched e-mail, for example.
Or to get all read messages without replies that include .patch files...
The criteria can be as general or as precise as needed.

1 Like

As you have already provided us with other Pull requests... don't stop now :slight_smile:

What we have done previously (in other nodes) is add to a select [ - set by msg.foo - ] where foo would be search or criteria or something useful... and once set that way the criteria would be allowed to be passed in, which is presumably what you wish to do.

Happy to discuss.

2 Likes

Here's a proposal:

I have tried this in a flow where node-RED fetches unread e-mails, downloads some linked files with credentials provided in them and replies to them with the files attached before marking them as read (by setting the criteria to match the message-id header of the original e-mail).

This is useful for many services that say "your monthly statement is now available at our company's portal, please log-in to see it".