homepage Welcome to WebmasterWorld Guest from 54.227.11.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Checking Email On The Way In
Mondo




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

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!

TIA

Mondo

 

physics




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

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
/var/spool/mail/root
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.

Mondo




msg:3184381
 5:23 pm on Dec 10, 2006 (gmt 0)

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.

physics




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved