Home
Man
Search
Today's Posts
Register

Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Executing of UNIX script using email

Tags
advanced, email, mail, procmail

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 08-09-2018
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
# 2  
Old 08-09-2018
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.

https://www.unix.com/man-page/suse/1/procmail/
The Following User Says Thank You to Neo For This Useful Post:
mirwasim (08-09-2018)
# 3  
Old 08-09-2018
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.
# 4  
Old 08-09-2018
Quote:
Originally Posted by jgt
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.
The Following User Says Thank You to Neo For This Useful Post:
jim mcnamara (08-09-2018)
# 5  
Old 08-09-2018
@Neo, thanks for the input, while browsing i came also across this procmailbut 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

Last edited by mirwasim; 08-09-2018 at 08:13 PM.. Reason: change of code to icode
# 6  
Old 08-10-2018
Quote:
Originally Posted by mirwasim
.... while browsing i came also across this procmailbut can you tell me were to read about it to implement it




https://www.unix.com/man-page/all/1/procmail/

https://www.unix.com/man-page/all/5/procmailrc/

https://www.unix.com/man-page/all/5/procmailsc/

https://www.unix.com/man-page/all/5/procmailsc/
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX script for consolidated email new2prog Shell Programming and Scripting 4 12-05-2016 03:57 PM
Executing Oracle script from UNIX Script vipin kumar rai Shell Programming and Scripting 3 07-16-2015 12:23 PM
Executing java .jar from UNIX script pankajkargeti12 Shell Programming and Scripting 4 07-08-2015 06:23 AM
sh script to get unix username of person executing it neil.k Shell Programming and Scripting 5 05-31-2012 12:35 AM
AWK syntax /bailing script error when executing in UNIX nandugo1 Shell Programming and Scripting 4 03-03-2011 07:51 PM
perl script to send an email executing with errors kabazzi Shell Programming and Scripting 2 04-20-2010 04:48 AM
executing SQL query using unix shell script nathanvaithi UNIX for Dummies Questions & Answers 3 12-04-2009 10:50 PM
Executing a shell script from windows;script present in unix rajneesh_kapoor UNIX for Advanced & Expert Users 4 05-08-2009 03:54 PM
Executing unix script on windows through MKSToolkit ammu Shell Programming and Scripting 5 01-20-2009 01:04 PM
Executing a Oracle SQL statement in a UNIX script ganga.dharan Shell Programming and Scripting 1 12-08-2008 10:44 AM
Executing SQLPLUS in UNIX Script from JAVA anooptech UNIX for Advanced & Expert Users 0 04-16-2008 09:53 AM
Doubt on Executing unix commands in script Naresh Kumar Shell Programming and Scripting 2 06-05-2006 08:49 PM
Writing and executing a script in RTR implementation of UNIX mahajan.anubhav Shell Programming and Scripting 0 03-16-2006 05:20 AM
Executing a .dll from a Unix script BCarlson UNIX for Advanced & Expert Users 2 03-06-2006 07:30 AM
sending email from KSH unix script. rosh0623 Shell Programming and Scripting 3 07-26-2005 04:36 AM


All times are GMT -4. The time now is 02:23 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password