tags:

views:

133

answers:

1

I have a feature in my app that handles and parses incoming emails.

The mails come in through the usual method with exim as a .forward file:

| /path/to/php /path/to/mail/handler.php

This sends RFC822 formatted text to my handler, which uses a parser to break it down and hand over to the rest of my app.

New feature needs to be added to forward any mails to [email protected] along to [email protected]

I'm trying to figure out a way to do this the most simple way. The long way is to take the parsed message, modify the To: address and send on as a new mail.

So my question is: What's the simple way to "forward" an RFC822 formatted message? Is there a way of telling exim to forward the mail instead?

+1  A: 

You should have Exim do this, not PHP. Mail servers are all about forwarding email. There should be a way to add multiple addresses in your .forward file. If you can't figure out how, http://serverfault.com/ is the place to ask.

Scott Saunders
Just to clarify - the mail handler isn't just for forwarding mails, this is a new feature to an existing mail handler that does all sorts of other stuff
mercutio