Run a script when I receive an email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run a script when I receive an email
# 1  
Old 02-14-2012
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 ......
also I need to set some parameter to this script .
The parameters are in the mail subject but I'm not able to get them.

Some one could help me to find a solution ?
Thanks and Regards
Emilio
# 2  
Old 02-14-2012
Depends how you're receiving the email. What's your code look like?
# 3  
Old 02-14-2012
I receive an email with this subject
AS400 EBZAA 20

I want use this subject as parameters of the script
/home/nag-script/startstop/AS400-Boot.sh
# 4  
Old 02-14-2012
I am reminded of an anecdote I read about years ago. There is a program called biff that will notify you when you receive mail. So what does the name "biff" have to do with receiving mail? The girlfriend of the guy that wrote it had a dog that would bark at the mailman, so they knew when the mail arrived. The dog's name? Biff of course. :-)
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check email successful sent and receive

We have a unix/linux server , that send mass email from it , the emails will pass the smtp gateway , email server and sent to the client , but sometimes the client do not receive the mail , we do not know the reason and when it will happen . We would like to have a script that check when the... (2 Replies)
Discussion started by: ust4
2 Replies

2. HP-UX

Unable to receive mails from email relay server

Hi, I have reports that are generated in one server (10.61.1.108), hostname l28bi01. These reports are supposedly sent to a group of email addresses hourly via an email relay server. However, this is not happening. In sendmail.cf in bi01, the DS Smart Relay Host ip address is: ... (3 Replies)
Discussion started by: anaigini45
3 Replies

3. Forum Support Area for Unregistered Users & Account Problems

Have yet to receive activation email

Good Afternoon, I attempted to register on this forum yesterday using the username 'DBirks', however I have yet to receive the required activation email. I have checked both my inbox and junk e-mail folder on my email client as well as on owa, but I have not seen any sign of it. I have... (1 Reply)
Discussion started by: Unregistered
1 Replies

4. Shell Programming and Scripting

UNIX Script to query Active Directory: give cn (NT login name) and receive mail (Email address)

Hi folks I need to write UNIX script (with ldapsearch) to query Active Directory. Input is NT login name and output is Email address. Attached a screenshot of Sysinternals "AD Explorer". I need to do the same in CLI. http://i.imgur.com/4s6FB.png I am absolute LDAP/ldapsearch noob. (0 Replies)
Discussion started by: slashdotweenie
0 Replies

5. Shell Programming and Scripting

email to group-id is failing to receive

Hi all, The below is the program i used to send a mail. #!/bin/ksh mailaddress=$(cat $HOME/email.txt) (cat | mail -s "TESTING LOAD STATUS on `date`" "$mailaddress") <<EOD ignore. this is a test mail EOD email.txt contains, like below GrouptID@mail.com,IndividualID@mail.com The... (5 Replies)
Discussion started by: Arunprasad
5 Replies

6. UNIX for Dummies Questions & Answers

Can send but not receive email

Hi, One of the users in our company can send but not receive email. We are using SENDMAIL in conjunction with procmail. The funny thing is that all his sent email is in his /var/spool/mail but the email client does not pick anything up! He is using IMAP. Anyone see have any ideas? (2 Replies)
Discussion started by: mojoman
2 Replies

7. 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
Login or Register to Ask a Question