alias : "|/path/to/script.sh"
This uses sendmail's rules syntax which says "If the left side of the colon is true, do what's on the right side." Note that there need to be spaces on both sides of the colon. The message received is fed as input into the script, if the script takes input. For example,
billing : "|/usr/local/send_invoices"
entered into /etc/mail/aliases will cause the send_invoices script to run each time a message is sent to billing@hostname. (Be sure there's a way a message can get to hostname.)
Remember to run newaliases after making any changes to the aliases file. Also, make sure the script to be run is world-accessible.
09/17/2001