Sponsored Content
Top Forums Shell Programming and Scripting Run a script based on the subject line of the email Post 302305863 by satekn on Friday 10th of April 2009 01:11:07 AM
Old 04-10-2009
i am trying to accomplish reding the subject line of the email and parsing the parameter to the script which i am creating to do the job.

The point is to run the script as soon as the email arrives.

Example:

Email: Sub: Dojob param1=ABC param2 = 3

i need a way to run the script like this. myscript.sh ABC 3.

Note: i already have the script which is run manually after reading the mail . I have to type the parameters and run it every single time. I now want a way or a program that can read this email subject(which has a fixed format) and run the script automatically.

I hope i am clear
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

use email subject line as shell command

If anyone can give me some ideas on this it would be great. What I'm trying to do is to have emails be sent to my unix account. Once they are emailed to the unix account, I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can... (4 Replies)
Discussion started by: mskarica
4 Replies

2. UNIX for Dummies Questions & Answers

run a script from incoming email

hi I have a bit of a problem i need help with. I have a script that runs no problems when i run it manually. as soon as i stick in tester: /app/scripts/run.pl into /etc/aliases & try to run it by sending a mail it doesnt work. the output files are owned by daemon, which i dont like & think... (7 Replies)
Discussion started by: jojo77
7 Replies

3. Shell Programming and Scripting

help with script to send email and if subject line match is found

Help with script that will check log, then find a match is found, add that as the subject line. 1. The script will always run as a deamon.. and scan the event.log file 2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies

4. Linux

Run PHP script when new email received

I have been looking around for a solution to this, i have been developing for a wile though am very new to CGI, PHP and a lot of the web based tech. I have a web site hosted with a cPanel web host. I am looking to have a script(prefer PHP) to run everytime i get a new email to help@xxx.com.... (16 Replies)
Discussion started by: iKris
16 Replies

5. Shell Programming and Scripting

Subject line of an email

Hi all, I am trying to automate a process in which at the end of the process the script should send an email to the user saying this process is completed. I have done everything but the problem now is the subject line of the email... the subject line looks like this.. where abc xyz is a... (4 Replies)
Discussion started by: smarty86
4 Replies

6. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

7. Shell Programming and Scripting

Run a script when I receive an email

Hi expert I wish to start a shell script when I receive an email. I modified the aliases file and I add this string as400nag: "|/home/nag-script/startstop/AS400-Boot.sh The solution works . When the as400nag user receive an email the /home/nag-script/startstop/AS400-Boot.sh starts .but... (3 Replies)
Discussion started by: emi65
3 Replies

8. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

9. Shell Programming and Scripting

Script that will send an email if the cron job did not run.

Team, Would like to know what is the best script that will send you an email if cronjob did not run. Thanks (4 Replies)
Discussion started by: kenshinhimura
4 Replies

10. UNIX for Beginners Questions & Answers

Variable not displaying in subject line of mailx email

Hi Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this: if ]; then export GAPNUM=`awk '{print $4}' $OUTFILE` if ] then mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
OCF_HEARTBEAT_MAILTO(7) 					OCF resource agents					   OCF_HEARTBEAT_MAILTO(7)

NAME
ocf_heartbeat_MailTo - Notifies recipients by email in the event of resource takeover SYNOPSIS
MailTo [start | stop | status | monitor | meta-data | validate-all] DESCRIPTION
This is a resource agent for MailTo. It sends email to a sysadmin whenever a takeover occurs. SUPPORTED PARAMETERS
email The email address of sysadmin. (required, string, no default) subject The subject of the email. (optional, string, no default) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 10. stop Stops the resource. Suggested minimum timeout: 10. status Performs a status check. Suggested minimum timeout: 10. Suggested interval: 10. monitor Performs a detailed status check. Suggested minimum timeout: 10. Suggested interval: 10. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a MailTo resource using the crm(8) shell: primitive p_MailTo ocf:heartbeat:MailTo params email=string op monitor depth="0" timeout="10" interval="10" SEE ALSO
http://www.linux-ha.org/wiki/MailTo_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 03/09/2014 OCF_HEARTBEAT_MAILTO(7)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy