views:

12

answers:

0

Hi guys, I'm working on shifting my local web application to google apps. I have an account already for google apps for business and right now I need to work on the functionality of interacting with email.

Let me give a synopsis - my web app currently was set up that a cron job would download all emails from a set mailbox into a database at short intervals and when each message would be entered they would be assigned a specific ID and we would be able to use that ID to refer to that message in our application wherever we would require. So basically our applications mail section gave the illusion of being a webmail client when nifact it would retrieve from a database. I'm interested in a solution with google apps on a similar case.

The thing is that the application initially when the cron job runs - not only does it download a the email from the mailserver but it would also delete the email from the mailbox. So basically we would refer to the email on our local database as that is where it would exist.

Now however I don't want to delete the email form the inbox at all. Infact I would like to set it up such that I can maintain a reference to an email on my gmail inbox and still have a copy in my local system or at the least a basic link to the email. The thing is that from my programming with email webclients I havent been able to find what is a UNIQUE ID for emails in the mailbox which could be used as a way to identify them from an external application - emails seemed to be numbered by sequence and the sequence changes when an email is moved between inboxes. The UID or unique ID value seems misleading as it is just a sequence number for that email which can change if earlier emails are deleted or moved about.

What would be the best way to do this?