I am working on a simple IMAP program. I have a module that does most of the heavy lifting, but need some conceptual help as I haven't really worked with IMAP from a developers point at all.

I want to be able to have an "offline version" (local copy). I also probably want to do all of the organizing of messages, folders etc locally and eventually "sync" with the server. There must be a standard way of dealing with this in IMAP.

I'm sure there is a better place to post this if anyone has a suggestion.