Sponsored Content
Top Forums Shell Programming and Scripting Run a script based on the subject line of the email Post 302305701 by nobody4 on Thursday 9th of April 2009 02:05:48 PM
Old 04-09-2009
You probably need to spec this a bit better.
It's not clear whether you need help with writing the "dojob.sh" script,
or with taking the subject line and using the information in it to invoke
the command "dojob.sh job1 copy1"

You might be looking for this:

$ sed -n -e 's/^Sub:.*job=\(.*\) copies=\(.*\)$/dojob.sh \1 \2/p' emailfile
dojob.sh job1 copy1

...which you could pipe to a shell to get it executed.



Curious people might want to know whether you have some way of intercepting
the emails and processing them automatically as they come in,
or if you plan to do this manually with copy/paste and your email client (for example).
 

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
NOTIFY(8)						      System Manager's Manual							 NOTIFY(8)

NAME
notify - HylaFAX user notification script SYNOPSIS
/var/spool/hylafax/bin/notify qfile why jobtime [ nextTry ] DESCRIPTION
bin/notify is the command script invoked by the facsimile server to notify a user about the status of an outbound job. The default notifi- cation script sends the user electronic mail describing the event or action. The arguments are: qfile the pathname of the job description file. why a string that specifies why the user is being notified; one of: Why Notes Meaning done 1 job was completed successfully failed 12 job was not completed rejected 1 job was rejected for specified reasons requeued 2 job was not completed, but was requeued for retry removed 1 job was deleted from the queue killed 1 job was deleted from the queue timedout 1 job could not be sent before kill time expired format_failed 1 document conversion failed no_formatter 1 the document conversion program was not found poll_rejected 12 a polling request was rejected by the remote side poll_no_document 12 a polling request failed because nothing was available poll_failed 12 a polling request failed for an unknown reason blocked 3 job is blocked by concurrent jobs 1 A final job state 2 A transcript of the failed communication is returned to the sender. 3 No emails are sent for the block state, the job has been neither requeued nor done, but remains waiting in the queue for the ability to be sent. jobtime the total transmission time of a successful job or the connect time of a failed request (passed as a string). nextTry the time (passed as a string) at which the next attempt will be made to complete the job. This parameter is passed only if why is ``requeued''. NOTES
The behavior of notify is intended to be customizable via the etc/FaxNotify script, if present. FaxNotify is sourced after the q-file is parsed and all default values are preset. Useful settings for FaxNotify are: WHY is identical to why mentioned above and can be useful in determining under what conditions various settings should take effect. For example, if [ "$WHY" != "done" ]; then RETURNFILETYPE=pdf; fi This would only set RETURNFILETYPE when the job did not complete successfully. RETURNFILETYPE can be set to ``tif'', ``pdf'', ``ps'', or ``original''. If set, this causes notify to return a copy of the submitted documents to the SENDER address along with the notification message. The ``original'' setting uses the format type that was used in the submis- sion. Multiple values may be specified by separating them with whitespace. In that case a separate attachment is created for each filetype. TEMPLATE the template subdirectory to use when sending e-mails. HylaFAX ships with a base set of templates, and some direct translations. To use the German translated templates, set TEMPLATE=de in FaxNotify. This is relative to the base template directory. NOTIFY_FAXMASTER is used to deliver a notification message to TOADDR (which defaults to ``FaxMaster'') that contains technical information about the job. This is useful in allowing the administrator to be aware of any problems before those problems are reported by the users. Possible settings are ``yes'', ``always'', ``no'', ``never'', and ``errors''. If ``errors'' is used then the notification message is only sent to FaxMaster when the job experienced an error. The default is ``no''. The settings of the user in $notify (read from the sendq job file) controls whether the user will get the notification email. If you want to force notification emails, irregardless of the users selection, or force a blocked notification (which is not sent by default), you can set notify="always" which will force the notify script to send the email. FILES
/var/spool/hylafax spooling area /usr/lib/sendmail for delivering mail SEE ALSO
faxq(8), hylafax-server(5), sendq(5) May 8, 1996 NOTIFY(8)
All times are GMT -4. The time now is 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy