Trying to setup a simple automation system has proved exceedingly complicated for me. Using scripts, I want to use email to perform remote tasks. The script outline:
- Send an empty body email with the header as "Pattern1 (number)"
- Read the last 50 email headers.
- Find latest header matching "Pattern2 (number)".
- Save (echo) the number from that header into a file.
- Wait 5 minutes
- Loop to 1.
I'm trying to using as few programs as possible. Currently, have Mutt for email sending and retrieval. And grepmail (with grepm script) for searching emails.
Am I way off on using Mutt and grepmail? I'm confused as a non-sysadmin. Mutt isn't great for scripting. What's the simplest way to set this up?