Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start script upon recieve email

Status
Not open for further replies.

blueeyedme

Technical User
Nov 27, 2002
39
NL
Hi.

I am trying to make a script that starts another script upon the recieve of a email.
For ex. When i send a mail with a string killuser abc, to a typicall adress (of the unix machine) it must execute a script that kills the user abc..

can anyone help ?

thanks
 
Warning -- this kind of operation can be extremely dangerous. In principle it provides a way for just about anybody to perform these kinds of operations on your machine.

If you still choose to do it, the script that will handle this should contain safeguards to (try to) avoid malicious or inadvertant problems.

Write the script myscriptname.pl so that it reads from stdin and operates based on what it reads. Then, in the file /etc/aliases, add a line like this:

userid: "| myscriptname.pl"

Any message sent to userid@hostname will be read by the script and handled appropriately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top