http://qs321.pair.com?node_id=187223


in reply to Invoking Perl script from an email

In addition to what hacker wrote, I would just like to say that, at least with sendmail, scripts like this are run by smrsh which require the script, or at least a link, to reside in some special place. On my machine (RH72) it seems to be /etc/smrsh, and I think that is fairly standard. So in your aliasfile you should probably write:
udb: "|/etc/smrsh/file.pl"

You could also use the .forward file in the users home directory to do the same. The script still has to be in /etc/smrsh, but you don't have to mess with the aliases file. Read the vacation or procmail documentation.

I once did a simple, but neat, thing that measured roundtriptime and availability of our customers mailsystems. I mailed a message to the mailservers, which forwarded them back to me, and I piped it all into a perl script. Finally all data ended up on a webpage, with RTT high, low and mean, and dropped mails and so on. It also sent me an email *ahem* if a mail was lost somewhere.