On 09/06/20 09:51, Kia Niskavaara <kia.niskava...@gmail.com> put forth the proposition: > Hi all > > I'm looking for a scriptable email client for linux cli. Specifically I > need to connect it to a Gmail account using IMAP IDLE so that I will be > able to find new emails almost immediately. And secondly, when new emails > arrive, I need a script that automatically parse the body of every email to > look if they match a specific regular expression - and if they match, then > another script should be executed. > > Is this possible with Mutt? Can someone point me in the right direction? > I've looked at the FAQ/Google, but couldn't find anything about this > scenario. > > Thank you > > Kia
Procmail is very good for filtering email, also in combination with `formail' to filter out portions of headers. Procmail can search the headers and/or body for regexps, and then run other applications, scripts, or forward emails depending on the results. I tend to use `getmail' running once a minute via a cron job, but I believe it can operate in an idle mode too. -- Dave