Well, this may take some time to explain:
I am working on creating an Email <> SMS bridge (e.g. Teleflip). I have some given parameters for work:
- Web Hosting Dreamhost
- PHP 5 (without PEAR)
- Postfix
- MySQL (if necessary)
Now I have a full email address that sends the email sent to the shell account. The shell account, in turn, redirects it to my PHP script.
The PHP script reads it, breaks several email headers to make sure it is sent correctly, and then forwards it to the number specified as the recipient. 5551234567@sms.bridge.gvoms.com , of course, sends SMS to +1 (555) 123-4567.
This works very well, as I parse the To field and grab only the email address to which it sends. However, I realized that I did not account for several recipients. For example, an email sent to both 5551234567 and 1235554567 (using the To line, the CC line, or any combination thereof).
How email works, I get two received emails, eventually parsing each one separately, and 5551234567 ends up getting the same email twice.
What is the best way to handle this situation so that each number specified in TO and CC can receive one copy of the message.
Also, although I doubt its feasibility: is there a way to handle BCC in the same way?
source share