Q:

Handling Incoming Mail to Multiple Recipients in PHP

Alright, this may take a moment or two to explain:
I'm working on creating an Email<>SMS Bridge (like Teleflip).   I have a few set parameters to work in:

Dreamhost Webhosting
PHP 5 (without PEAR)
Postfix
MySQL (If Needed)

What I have right now, is a catch-all email address that forwards the email sent to a shell account.   The shell account in turn forwards it to my PHP script. 
The PHP script reads it, strips a few Email Headers in an effort to make sure it sends properly, then forwards it to the number specified as the recipient.   5551234567@sms.bridge.gvoms.com of course sends an SMS to +1 (555) 123-4567. 
This works really well, as I am parsing the To field and grabbing just the email address it is sending to.   However, what I realized that I did not account for is multiple recipients.   For example, an email sent to both 5551234567 and 1235554567 (using the To line, the CC line, or any combination of those). 
The way email works of course, is I get two emails received, end up parsing each of them separately, and 5551234567 ends up getting the same message twice. 
What is the best way to handle this situation, so that each number specified in TO and CC can get one copy of the message. 
In addition, though I doubt its possible: Is there a way to handle BCC the same way? 

A:

Although wimvds had the best answer here, I found out elsewhere that Dreamhost includes a "X-DH-Original-To" header in the way I'm running it through the system.   Using this, I'm able to send to each number individually upon receipt of the email without checking it against a database.   This should also work with Blind Carbon Copy (I don't know the specifics of how email works enough to tell you how that works).