Archived Forum Post

Index of archived forum posts


Sync server emails with CoreData emails

Jul 15 '14 at 21:28

In which format should I save the email to Core Data.

I'm currently saving everything as strings, eg. email.Body, email.Subject, email.FromName etc to single attributes in an email entity. The problem is I cant go fetch that exact email on the server when saving/opening it.

What primary key can I use to "sync emails in core data with server", having the exact same emails. If i delete the email from database it should fetch primary key to delete it from the server as well.

This is obviously my first time I've been using Chilkat, really awesome API and would like to learn all there is about it!

Any help would be much appreciated, thanks!


First - I don't work with IMAP so I can't be sure this will work, but there is a GetImapUid method that according to some quick research I've done, might return an unchanging unique ID for a message in an IMAP mailbox. You could use this ID to handle synchronization with a specific IMAP server.

Check out section 2.3.1.x of RFC3501 INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1 for more information about IMAP UIDs.