Sync Kolab

SyncKolab was written to add kolab functionality to thunderbird. It reads a selected Imap folder and synchronizes it with the local address book and calendar.
It has been tested under Thunderbird for Windows and Linux.
If you find any bugs please check the synckolab bugzilla on: http://synckolab.mozdev.org/bugs.html this software is OpenSource

What is Kolab?

What it does is, that it loads all your contacts (from a selected address book) as well as events and todos (from the selected calendar), and synchronizes them with a selected imap folder. Where every contact is stored as an vcard and every event,todo as iCalendar. For more information http://kolab.org/
The idea behind this is, that you can now have your contacts+calendar entries stored on the imap server. so you can actually have the same addresses on more than one computer. The kolab project has a groupware server that uses imap to exchange calendar entries and vcards. But you can also setup simple sharing in your office if you have f.e. cyrus by symlinking shared folders.

Getting the source

The source is included in the xpi. You can check it out in your profile directory under extensions/{571CFACF-0F7D-49b4-BD77-E6FC7B209ADC}/chrome/content/ or if you unzip the xpi (just rename it to .zip and use you favorite unzip util)

STATUS

If you find a bug submit it to bugzilla and/or post it to the mailing list (found unter http://synckolab.mozdev.org/list.html

To V 0.5.0 To V 1.0.0

I think I should be able to reach V1 within a month (depending on my time), except some of the testing since I do not have only linux or windows systems.

Installation

SyncKolab 0.4.34+

Step 1: Download the lightning plugin then the extension (use "rightclick/save as" otherwise firefox will try to install it)
Step 2: Open Thunderbird and use Tools/Extensions then install the downloaded calendar and the synckolab xpi
Step 3: Restart Thunderbird
Step 4: Configure the plugin
Option Menu under Tools
(1) will open the configuration wizard
Optional Step 5: get the icon


rightclick on the icon bar (2) (next to Stop) go to customize and drag the "Sync Kolab" Icon (3) to the bar (4)
Step 6: click the icon or menu entry and the sync will start
Optional: Since you cant drag the button into lightning, try the Custom Toolbar extension and create a new toolbar there.
MAKE SURE YOU READ THE RELEASE NOTES OF THE VERSION!!!

Configuration Wizard


(2) Choose a configuration display name. Make sure you do not use any special characters (including "-,.+# ) as name. If you entered a non-existant valid name, the next button will become clickable.

(3) Select an imap account. If you do not see anything in the account box, you probably do not have an imap account. Ask your Internet Provider or System Administrator for an IMAP Account.

Select which kind of data you want to sync. Calendar and Tasks will only be selectable if you installed the lightning extension.

For each data-type (Contacts, Calendar, Tasks) you will see a similar wizardpage.
(4) select the adress book/calendar you want to use for syncing
(5) select if you want the (prefered) xml/kolab format or the vcard/ical format. It is recommended to use the xml format because the vcard/ical format is very outdated and not as clearly specified.
(6) select the folder that should be used for sync. Make sure you specify a different folder for calendar/adress book and tasks, otherwise the sync may fail
(7) The checkbox is only important for shared folders where you have read-only access. This makes sure synckolab does not try to write any data into the imap folder
Once you configured all of this the next Button will become clickable and take you to the next page.

Configuration

Option Menu under Tools
(1) will open the configuration wizard (if its the first time you use synckolab) or the configuration dialog if you already have a configuration.

synkolab settings

  1. Here you see all your defined configurations. Under each configuration your find your sync-datapoints (clicking on an item will open one of the ocnfiguration screens as shown in the images)
  2. This dropdown box lets you select the calendar/adressbook used for syncing
  3. In the list of folders, select an imap folder to sync with
  4. Contact Format: Select the (prefered) xml/kolab format or the vcard/ical format. It is recommended to use the xml format because the vcard/ical format is very outdated and not as clearly specified.
  5. Save to Imap Folde: The checkbox is only important for shared folders where you have read-only access. This makes sure synckolab does not try to write any data into the imap folder uncheck this box. This will overwrite the local data on each sync.
  6. Sync: Unchecking this box means that you do not want to sync the data at all.
  7. Close Sync Window when done: unchecking this will keep the sync window open after a successfull sync
  8. Account: Select the imap account which should be used for sync. Make sure that you configure the folder correctly after changing this or there will be errors
  9. Sync Interval: The sync interval is 0 per default (do not sync automatically). You can change this to the number of minutes between each sync. If you want auto-sync use 5-10 Minutes for autosync in a workgroup. Depending on the internet connection and imap server you can decrease this number.
  10. Add: Click here to open the configuration wizard for a new configuration
  11. Delete: this will remove the currently selected configuration

How does Sync Kolab sync your entries?

For those interested here is a short explenation (pretty technical) on how Sync Kolab actually works.
When a sync is started (doesnt matter if its a calendar/task or adress book sync):
  1. get a list of all messages in the imap folder (only headers, which are cached locally. Thunderbird also makes sure that new messages are included)
  2. check each message header with a local database of the previous sync for a change. Message size, date and subject are used there (subject is the key value)
  3. if something changed or the message is new, download the message and strip everything except the message body (xml/ical/vcard). Save this part in the local sync database (=the file system)
  4. parse the message body into a adress book card/calendar event/task (lets call it CUR)
  5. get the id from CUR and check the local address book/calendar if there is an entry with the same id (lets call it ENTRY)
  6. if we did not find an ENTRY, save CUR in the adress book/calendar and continue
  7. if we found an ENTRY, make a comparison between CUR, ENTRY and LOCALDB (the entry stored in the local sync database (file system) from a previous sync)
  8. remember all entries already processed (so we dont check it twice)
  9. now go through all local entries (ENTRY) (except the one we already processed) and check:
  10. finish up (liek make all new messages unread, and run compact to make sure its all on the server)
A few Remarks:

Known Issues/Todos

If you find any bugs please check the synckolab bugzilla on: http://synckolab.mozdev.org/bugs.html

Planned features

prerelease notes of cvs version

synckolab 0.6.2 (CVS version from 08-05-2008 17:30)

For Thunderbird 3.0a users:
Because of the new "Secure Update" Resitrictions the install of the nightly will fail. In order to still use the most recent synckolab add following to your prefs.js: user_pref("extensions.checkUpdateSecurity", false); Also right now it doesnt work with all tbird3 builds (there are some bugs which prevent certain functionality)
* Added prefer-mail-format to contacts (XML Format) * contact now displays displayname if no name/surname is given * calendar now correctly writes/reads sync db file (speedup) * calendar finally syncs correctly (bad error in database file) * added seamonkey to the installable targets * mail format changes recognized * successfully tested calendar sync with thunderbird 3.0a1 * added seamonkey target application * hu-HU translation added * added possibility to use -1 as sync time to sync ALL entries * fixed #1801: multiple attached cards/xmls are now handled correctly * fixed Problems with newlines on parsers (two newlines made the parser cut off the xml) * fixed a problem that sometimes prevented multipart messages from being parsed as xml correctly * base64 errors fixed (if the =NUM was in the text it was accidently used as base64) * added option to specify debug level (default:warning - set to DEBUG if you got a problem)
You can get a cvs built version from here.
Beware that this may break all you contacts/calender entries, altough we try to create stable nighlies.. Nightly builds now show their date in the option and install file
Changelog:

Release Notes

synckolab 0.6.0

This is apretty big release since < 0.4.34.

In case you have problems:
- uninstall synckolab
- remove all lines containing synckolab from your prefs.js (in your thunderbird profile folder)
- remove all *.hdb files from your profile folder and the synckolab subfolder
- install 0.6.0 and configure everything

Changelog:
* renamed global variables to remove side effect with other extensions
* added check for the "imap-deleted" flag
* huge speed increase by using hashmap instead of array for internal calendar/contact database (about 500 entries/minute)
* reduced cpu usage and removed deadlocks (also due to hashmaps)
* changed flags for temporaray files (now use 0600 instead of 0666) so they arent world readable
* added priority flag for todo/agenda
* fixed little bug that prevented additional info files to be written correctly
* fixed location for cache folder (might result in a longer wait for first sync - again)
* fixed delete
* prepared code for 3.0a
* fixed problems with calendar sync

Older Release Notes

Contact and Help

In case you find a bug or have any suggestions on what to add, you should subscribe the mailing list on mozdev.org .

In the wild...

I started a few threads around the globe on different sites during development. If you are interested in some insight you can check them out.

This one is for those who have ideas on how I overcome some of my biggest problems: open a tb message in read/write mode
Antoher problem I ran into (which could have been avoided if the rewrite stuff had worked): Copying mail folder content from temp folder to imap I took some of the code from the TB Attachment Tools and TB Header tools for the writing of messages. You can get those pretty usefull extensions from Frank DiLecce (Ausdilecce).

Get Thunderbird