Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Checking Email On The Way In

4:54 pm on Dec 10, 2006 (gmt 0)

10+ Year Member

Hi all

I've got my own LAMP server and I need to be able to check emails as they come into the server. What I need to do is check to see if an email has been received from PayPal, and then if so, extract an item ID from the body of the email then run a script to update a database.

Is there something prebuilt into the OS that could deal with this?

Any information would be great as I'm supposed to launch something tomorrow and I can't until I've resolved this!



5:02 pm on Dec 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

There is probably a better way to do this but if I were you I would just parse the mail file every 5 minutes and extract the new id. You can probably do a tail on it to avoid parsing the whole thing. So if the mail is going to root then the mail file is in
and you could write a script to parse that (or the last 1000 lines of it to save time, depending on your volume) every 5 minutes, get the id's, insert any new ones into the db.
5:23 pm on Dec 10, 2006 (gmt 0)

10+ Year Member

Sounds like a good idea, and it should be within the realm of my technical capabilities (just) ;). I'll give it a go.

BTW Thanks for replying.

8:55 pm on Dec 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Glad to help, hope it works. If you find a better way (now that you have your 'hack' solution in place) please let us know.

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month