On Thu, Jul 31, 2008 at 12:33 AM, Paul Swafford <[EMAIL PROTECTED]> wrote: > 1. check email account (local or remote) Well, which one? Local or remote? It makes the difference between reading an mbox file (or maildir ..) and opening a network connection to a POP or IMAP service .. Do you want this to happen in real-time as part of the email delivery process, or just to run every few minutes?
> 2. extract data from subject line and body How predictable is the body? Is it arranged strictly in lines, or can your data be spread over multiple lines? Is it MIME encoded, or plain text? > 3. write this extracted data to a database table (local or remote) Should you be looking into the db first to see if the current email matches existing data, or just blindly submitting data? The most elegant solution would be to run a "product" that does what you're looking for. What are you looking for? If the emails are coming from people, it's probably some sort of "email support" process ... and there are plenty of "email support questions => ticketing database" solutions out there (RT, Trac, bugzilla, etc. etc.) If the emails are coming from automated systems ... well, quite frankly they probably shouldn't be using an unreliable transport mechanism like email in the first place. Use a real-time receiptable message queue system like XMPP (Jabber) instead. No-one can (knowingly) offer an elegant solution if you don't actually tell us what the problem is :-) -jim
