SnappyMail CardDAV: a fork that does not delete your contacts
The contacts counterpart of our CalDAV fork. Same origin, same reason to fork — plus one extra defect, and this one is destructive: the upstream plugin force-re-enabled a two-way sync an administrator had deliberately turned off.
Why fork
Mailbux’s CardDAV Auto plugin targets one specific infrastructure, its author’s. Two hardcoded assumptions make it unusable elsewhere:
- the vendor’s hostname is written into the code, so contacts never reach any other server;
- the account’s
contacts_syncentry is rewritten on every login. A manual correction is silently overwritten at the next sign-in — the kind of behaviour that makes you doubt your own configuration.
Cyrus serves /dav/addressbooks/user/<user>/<collection>, discoverable through the standard addressbook-home-set property (RFC 6352). Again, nothing exotic: it is what compliant servers do.
The URL is configuration, not code
The URL now comes from the plugin’s own settings page, as a template with {user}, {email}, {login} and {domain} placeholders:
| Setting | Example |
|---|---|
| CardDAV URL template | https://dav.example.com/dav/addressbooks/user/{user}/Default/ |
| DAV default domain | example.com — addresses in this domain use the local part only; empty means always the full address |
The default domain matches Cyrus’s virtdomains: userid: a mailbox in the default domain is addressed by its local part, everything else by the full address.
And as with CalDAV: no built-in default. With no template configured the plugin logs a notice and leaves contacts_sync untouched, rather than writing a URL that cannot work. Doing nothing is the correct behaviour when you don’t know.
A disabled sync must stay disabled
This is the fix that justifies the fork on its own.
The auto-configuration hook runs on every login and unconditionally re-enabled two-way sync, including when an administrator had explicitly set Mode: 0.
That is not a cosmetic annoyance. A two-way sync against an addressbook that merely looks empty deletes local contacts: a freshly created addressbook, a corrupted server-side DAV index, a PROPFIND response that failed to parse — and the first sync wipes. Turning the sync off is exactly what you do when you suspect a problem; watching it re-arm itself at the next login removes the only protection you had.
An existing Mode: 0 is now preserved.
This is not a theoretical scenario: on a Cyrus server whose per-user DAV index had lost its records, the addressbook PROPFIND returned zero entries while the mailbox still held its vCards. A two-way sync run in that state deletes the local contacts, and recovery is a dig through the database. Being able to turn the sync off — and have it stay off — is the elementary protection against that kind of moment.
Licence and attribution
The fork keeps the original plugin’s licence (© 2025 Mailbux) and keeps the upstream README intact, below ours. It exists only to make the plugin work against standards-compliant CardDAV servers.
Install it alongside the CalDAV plugin, which carries the logic shared by both.
→ https://github.com/FathiBenNasr/SnappyMail-CardDAV-Plugin
Running Cyrus, Postfix or Sendmail and want a self-hosted webmail with calendars and contacts? See our services or let’s talk. And follow us on GitHub.