|
How do push emails to PHP via Sendmail
Hi Guys,
Right let me explain my situation, about 4 years ago I worked on a booking system for an entertainment agency, now recently they have been giving each agency their own email address and each broker within that agency also has their own email.
Now this all works fine, but recently ive been drafted back in again to apply some changes and updates to the system to bring some extra features and technology, one of the features they have come up with is the ability to 'file' incoming emails against a contact on their database ...
So, heres the plan
1. Use a catch all type system and push any incoming email to PHP
2. Use PHP to save emails into the database where the username match's
3. Return error on any unmatched user
4. Delete email (if needed!)
Now originally we thought of getting PHP to check a pop3 mailbox every xx seconds etc, but then decided this wouldnt be accurate, it would require a LOT of connections and cause some performance problems. The next problem was that the agencies and brokers are changing daily, hence keeping track with pop3 mailbox's would be crazy, we are talking approx 14,000 users each with their own email.
So its been suggested about getting Sendmail to pipe data into a PHP CGI script so its inserted direct to a MySQL backend, from there the normal system can then use this data as it sees fit ... However, Ive never done this before ... does anyone have any clues as to ways about this? best practices? sample code ...
Really looking for a starting point on this one, tbh what we are really looking at is a webmail system where the mail is stored on a MySQL database as soon as its recieved.
I look forward to the debate and replies to come, I hope someone can help.
Thanks
Mike
Btw, the server is a linux based with PHP 5.2.6, cPanel and the latest stable release of sendmail.
|