On Thu, Jan 21, 2021 at 8:47 AM Rich Shepard <[email protected]> wrote:
> On Thu, 21 Jan 2021, David wrote: > > > I'm not sure about the "easy" part, but take a look at procmail and its > > recipes. > > > > I don't use it, but the utility ingests mail, analyzes it, and then > "takes an > > action" which is generally just a routing of some sort. > > > > There shouldn't be any reason why you might be able to trigger a script > > instead. > > dafr, > > I do use procmail (to route messages to the appropriate file). It would not > work for Michael's needs because it distributes arriving messages. > > From the procmail man page: " Procmail should be invoked automatically over > the .forward file mechanism as soon as mail arrives. Alternatively, when > installed by a system administrator, it can be invoked from within the > mailer immediately. When invoked, it first sets some environment variables > to default values, reads the mail message from stdin until an EOF, > separates > the body from the header, and then, if no command line arguments are > present, it starts to look for a file named $HOME/.procmailrc. According to > the processing recipes in this file, the mail message that just arrived > gets > distributed into the right folder (and more). If no rcfile is found, or > processing of the rcfile falls off the end, procmail will store the mail in > the default system mail‐ box." > > Rich > I might not have been clear. I'm not looking for something that reacts to the receipt of email. I need a given script to execute based on what is in either the Subject or Body of the email. For example, I send an email to [email protected] with something like RESTART_FOO in the Subject or Body and it would run the script RESTART_FOO. Another email sent to the same address may say RESTART_BAR and execute that script. From what I understand, procmail simply reacts to an incoming email, regardless of what is in that email. Michael _______________________________________________ PLUG: https://pdxlinux.org PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
