Forward Script

Here is wat iam looking for , I need a forward script which sends out a mail to a particular server say (B-server) as soon as it receives a mail from differnt server say A-server.
Lets say abc@xyz.com is sending a mail from server A to Server B then the script should automatically send a mail to def@rts.com on Server C
Because i could able to send the mail to the server but my question here is ,do i need to schedule a job or sme thng which checks for the email in the inbound directory and if found shoots out the email to the desired destination problm,that would be great if i dnt have to schedule smthg.
Any sample scripts will be of gr8help to me
Can Any one help me with this script
Thanks in Advance.
Sri

Sounds like procmail. It simply triggers when you receive a message, so no additional hooks are required (but there are differences depending on how exactly you hook it in).

What do you mean by "server A", "server B", and "server C"? Do you need something to happen on a different server than the one where the message is received? Do you need the outgoing message to be sent from a different server than the one where the message is received? If either of these is yes, can you use ssh to accomplish that part? Procmail as such just kicks off a shell script so whatever you can script, you can use from Procmail.

Thanks Era
for ur reply , i Never worked on procmail,
Basically iam dealing with 3 servrs
1) Where a alert is Generated thru a Mail lets call it Server A
2) Server B which recives the alert mail from Server A and Shoots out a mail to Server C as soon as it recieves the Mail.
Please Let me knw if iam not clear !!
Thanks