Freelance Projects

All Freelance Projects at One Location


Pop3 Emails Into Mysql Table  31.01.09

Hi Experts,
I would like a script that will run as a linux cron job that checks certain POP3 email accounts (the pop3 accounts are on the same server – not sure if that makes a difference).
The script should look for ‘ ordercodeXXXXXX ‘, ‘ ordercode XXXXXX ‘, ‘ order code XXXXXX ‘ or ‘ order code XXXXXX ‘ in the subject line. XXXXXX being a unique ordercode of varying length.

When an email like this is found it should populate a mysql table with the following:

id, ordercode, cid, from, to, subject, time received, short_body, full_body, attachments

id is just an auto increment field.
ordercode is the XXXXXX number. (if CID: XXXXXX if found but no ordercode XXXXX then this remains blank)
cid is only populated if ‘CID: XXXXXX’ is found in the subjectline.
short_body being the first 300 chars of the body and full_body being the entire email body (without headers).
attachments should just include the filenames separated by comma but not the actual attachment

The email accounts to check are retrieved from table called adminusers, the fields being ‘email_login’ and ‘email_password’.

When an email has been found by the above criterea and processed, it should be deleted from the server. All other emails are just left in the pop3 account.

Just to summarise.. the script looks for either CID: XXXXX or the ordercodeXXXXX variants mentioned above. Either one will cause the script to save the email details in the mysql table.

The script should be written in a language that uses minimal resources. Please post what language you propose to use.

Look forward to hearing from you.

Thanks in advance,
Martin

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Twitter
  • Facebook
  • StumbleUpon
  • Slashdot
  • Technorati
  • BlinkList
  • Reddit
  • DZone
  • Live
  • NewsVine
  • LinkedIn
  • Yahoo! Buzz
  • MySpace
  • Netvibes
  • Tumblr
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • Print
  • RSS


If you liked this project, make sure you
Subscribe to Freelance Projects RSS feed!