Handling mail forwarding with php
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: addr开发者_如何学JAVAess 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?
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.
精彩评论