Executing of UNIX script using email

Dear Unix Leads,

can you please let me know is it possible to execute a shell script in UNIX machine sending an email from outlook or gmail ? or is it possible to generate a token file in UNIX by sending email which we can indirectly use to trigger script

your response on this is highly appreciated

Anything is possible, almost.

Normally, it's best to trigger remote shell script by methods other than sending email messages.

However, if you insist on running scripts based on email, there are plenty of utilities to do this based on what platform you are running on.

I used to use procmail for these kind of tasks.

1 Like

you can also create an alias that begins with a pipe (|) so that the email becomes standard input to the command/script following the pipe.
see the file /etc/mail/aliases and the newaliases command.

Yes, that is one way to do this; but if people are not careful and do not have a lot of experience, they can quickly get themselves in unforeseen security problems.

It's more secure to use an application package with some security, filters and configs built into the app.

1 Like

@Neo, thanks for the input, while browsing i came also across this procmail but can you tell me were to read about it to implement it

i have some scripts running in unix machine which i execute upon confirmation from other people.i want to make it easy, in spite of logging into my pc and unix machine i want to send an email from my mobile or PC which should trigger this script or scipts