0

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 foo@mysystem.com along to bar@othersystem.com

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?

mercutio
  • 22,151
  • 10
  • 36
  • 37

1 Answers1

1

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, https://serverfault.com/ is the place to ask.

Community
  • 1
  • 1
Scott Saunders
  • 29,840
  • 14
  • 57
  • 64
  • 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 Nov 24 '09 at 17:26