Claws-mail + vdirsyncer (sync contacts)

The steps I followed to sync my remote contacts with the claws-mail mail client:

Step 1: Configure vdirsyncer:

Create a new directory:

Then create a vdirsyncer configuration file “config” in the default vdirsyncer dir that will probably be this one:

This file must look like this:

After that you can run:

Step 2: Add your contacts to claws-mail:

Go to:
Tools->AddressBook and select: Book->New vCard

Type a name for your vCard entry and select the downloaded *.vcf file that should be in your .contacts directory after the vdirsyncer sync.

add vCard entry to claws-mail

If you have many vcf files in your directory and you don’t know which ones are valid vCard entries you can press Check File and validate there are no error messages first. Press ok and you will see your remote contacts appear in the Address book. Something like this:

contacts in claws-mail

I’ve hidden some “sensitive” info although the screenshot was from a list of Igalians, that is public in our site anyway. :p

Step 3: Create a cron job to sync the contacts automatically:

In case you don’t want to manually run vdirsyncer sync every now and then you can automate it by creating a cronjob. (Note that sync will also update your calendars if you followed the optional steps, so better use “sync contacts” if you only want to sync the contacts)

I wanted to sync everything once a week early in the morning so my cronjob looks like:

And that’s it.

Note: As I discovered later, if the contacts are frequently updated on the server and UIDs that belonged to deleted contacts are reused for new contacts, you might see some error messages that sync is not possible and you need to use --repair-unsafe-uid or some other parameters. The easiest way to fix this problem, is by purging your .config/vdirsyncer/status directory before retrying. Good luck!

4 thoughts on “Claws-mail + vdirsyncer (sync contacts)”

  1. I must be doing something wrong but I can’t figure it out. The contact syncing works great but the calendar syncing throws the following error:

    $ vdirsyncer discover my_calendar
    error: Pair my_calendar does not exist. Please check your configuration file and make sure you’ve typed the pair name correctly

    The backend I’m using is Davical and I’ve used your configuration substituting “your_calendar” with “my_calendar”. Any ideas?

    1. Other people also complained that following these steps didn’t work for them, I am going to double check it and update my post. I most probably forgot to write something. Apologies!

  2. hi!

    you speak about CalDAV syncing at the head of your post. But you describe a WebCal subscription later on:

    “Now you must see a new entry in the accounts section called β€œvCalendar” where you can add your calendars if you right click vCalendar and select: Subscribe to WebCal”

    WebCal isnt CalDav — is there any trick I didnt see?

    greets from germany,

    martin

    1. Good point, my steps don’t seem to work. I am going to remove the calendar part completely and make a new post as soon as I re-do and fix the steps πŸ™‚ Sorry!

Leave a Reply to Ted Cancel reply

Your email address will not be published. Required fields are marked *