login about faq

This is more of a conceptual question.

When working with IMAP 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.

Thanks

asked Dec 29 '12 at 14:24

JackP's gravatar image

JackP
1111


Jack,

Unfortunately, there isn't a standard way of doing what you described. Your app would need to select each folder one-by-one, get a list of local UID's and compare it with the UID's on the server, and then decide which emails to download, upload, or delete, depending on what behavior you desire.

link

answered Dec 31 '12 at 10:19

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for your reply, thought you might say that.

Since I havent really worked with IMAP before please tell me if this would be the correct approach:

I am going to create a local database file that mirrors the folder structure on the server (ie inbox.db) the DB will store the UID of the folder, and the UIDs, subject and body of all previously sync messages in that folder. While this local DB is displayed to the user and the user is working with it, I will download in the background FetchBundle ALL messages in the current folder. I will then update the server with any DB changes and vice-versa using the bundle as my reference. Also when the user changes folders or logs out, I will update the current folder with any changes to either side.

Assuming above is the best approach, then is there a function, or how do I tell if there has been an update to the server since I last cached the bundle?

Also, is there a full offline copy of the ActiveX reference for IMAP I can download (objects, properties, etc)?

link

answered Jan 01 '13 at 11:48

JackP's gravatar image

JackP
1111

Jack,

You will also need to check UIDValidity for each IMAP mailbox. If UIDValidity changes (it is a 32-bit number), then all server uids should be considered invalid.

link

answered Jan 03 '13 at 04:00

Krisb's gravatar image

Krisb
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×175
×9
×3
×1
×1

Asked: Dec 29 '12 at 14:24

Seen: 1,279 times

Last updated: Jan 03 '13 at 04:00

powered by OSQA