My requirement is pretty simple. I need to set up a server (bar.com), where you can send an email to that domain (e.g. foo@bar.com). I need the server to then examine the first part of the receiving email address ('foo'), send that value to a PHP script, have the script produce a list of email addresses that the email should be redirected to, and then send the email along to those addresses. The end recipient should see that the email was from the original sender and was sent to foo@bar.com. So basically, I need a very simple mailing list system that dynamically finds a list of recipients via a PHP script.
Full example:
- 'jack@sender.org' sends an email to 'email-list@server.net'
- Postfix on server.net receives this email, and calls a PHP script using the argument 'email-list'
- PHP script queries a database, does some filtering, and other custom stuff, and eventually comes up with a list of email addresses that should receive this email (this list might contain two email addresses, james@recipient.ca and jordan@receiver.net)
- Postfix gets this list of addresses and sends the email along to all of them, keeping the 'To:', 'From:', and 'Subject:' headers exactly the same as the original email
- james@recipient.ca receives an email in his inbox that shows it was sent from jack@sender.org to email-list@server.net
Does anyone have any suggestions of the best way to do this?
Thanks!
برچسب:
نویسنده: استخدام کار