I want to extract some header information from emails sent to my server and have them trigger a script that can use the information from the email. I don't want to use email forwarding, which is the simplest solution of course.
So this is what I would like to happen
1. email sent to to: email@example.com from: firstname.lastname@example.org (or wherever)
2. extract user1 and add it to the forwarding address using a script triggered by the incoming email, ie the script sends an email to email@example.com and includes the message body and it appears to come from firstname.lastname@example.org not the user's original sending address (ie gmail, hotmail, isp etc)
This is because my service provider sometimes sends computer generated non-delivery emails back to my users, and I don't want them to know who my service provider is (otherwise they may not use my service!!). If delivery is successful my provider does not send a reply. Similiariliy when my service provider emails back I would like a script to extract the message body and send it to the user.
I think I need to use sendmail and some perl (or other) scripting for this?
Also I rent the server from a hosting company. It's not dedicated to me, it just allocates certain bandwidth and diskspace to me according to how much I want to pay. I have cgi-bin, but I'm waiting for them to inform whether or not it has sendmail or if I can install it.
This is my first question here, so I hope I'm using the right language and making sense. Please help. Thanks