👤
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
email, mail, procmail

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 1 Week Ago
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 1 Week Ago
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 (1 Week Ago)
# 3  
Old 1 Week Ago
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 1 Week Ago
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 (1 Week Ago)
# 5  
Old 1 Week Ago
@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; 1 Week Ago at 07:13 PM.. Reason: change of code to icode
# 6  
Old 1 Week Ago
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
Executing Oracle script from UNIX Script vipin kumar rai Shell Programming and Scripting 3 07-16-2015 11:23 AM
Executing java .jar from UNIX script pankajkargeti12 Shell Programming and Scripting 4 07-08-2015 05:23 AM
sh script to get unix username of person executing it neil.k Shell Programming and Scripting 5 05-30-2012 11:35 PM
perl script to send an email executing with errors kabazzi Shell Programming and Scripting 2 04-20-2010 03:48 AM
executing SQL query using unix shell script nathanvaithi UNIX for Dummies Questions & Answers 3 12-04-2009 09:50 PM
Executing a shell script from windows;script present in unix rajneesh_kapoor UNIX for Advanced & Expert Users 4 05-08-2009 02:54 PM
Executing unix script on windows through MKSToolkit ammu Shell Programming and Scripting 5 01-20-2009 12:04 PM
Executing SQLPLUS in UNIX Script from JAVA anooptech UNIX for Advanced & Expert Users 0 04-16-2008 08:53 AM
Doubt on Executing unix commands in script Naresh Kumar Shell Programming and Scripting 2 06-05-2006 07:49 PM
Executing a .dll from a Unix script BCarlson UNIX for Advanced & Expert Users 2 03-06-2006 06:30 AM


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

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