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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email alias that calls a script

Status
Not open for further replies.

pho01

Programmer
Mar 17, 2003
218
US
Hi all,

I know this can be done, but I don't know or have no idea how to set this up. I'd like to set an email account, when someone sends a message to this account, a script is called and check the information in the message. Based on the syntax of the message, it will do some actions (the script will run and do whatever it needs to do)

Would someone explain little more about it and how to request such email alias to the unix system admin?

Thanks much
 
Ask your sysadmin to edit /etc/mail/aliases and add a line like
[tt]aliasname : |/full/path/mailhandler [/tt]
and run the newaliases command to rebuild the alias db.

When you write your mailhandler script, note that the mail message will be piped in. So either use something like "> /tmp/afile.$$" in the top of the script and then precess the file or just use awk (I would).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top