Redirecting an e-mail to a script

Shane Presley shane.presley at gmail.com
Thu Oct 28 02:10:56 UTC 2004


Hello all, thanks for the help so far setting up my FC2 system. 
Sendmail is now up and working great.  I can send and receive mail on
my server.

My next task is that I want e-mail sent to a certain address to
redirect to a script.  Specifically this is for BigBrother network
monitoring.  Mail sent to bb at myserver.mydomain.com should get
redirected to a script /opt/bb/bin/bb-mailack.sh.

So I was told that all I had to do is put a .forward file in /home/bb
and use the .forward file to call the script.

But that wasn't working.  I did some more research, and read that
sendmail (recent versions) won't execute scripts.  Someone told me me
that I could fix this with smrsh.  I put a link in /etc/smrsh to point
to /opt/bb/bin/bb-mailack.sh.  So now my .forward file calls
/etc/smrsh/bb-mailack.sh. It has execute permissions.

But it still doesnt seem to fire off that script when my bb account
receives e-mail.  It just goes to /var/spool/mail/bb.

In conversation with some folks here they also mentioned that:
      -I may have to use an alias, not a .forward
      -I may have to install procmail

But I guess that's where I get lost.  Not sure how to use an alias
(limited sendmail experience), and no idea how procmail would need to
fit in.

Any advice? Thanks as always,
Shane




More information about the fedora-list mailing list