Hi,
I’m new to mailcow (running 2025-12) and still figuring things out. I’m trying to migrate from Exchange to mailcow, but I’m struggling with CardDAV/CalDAV connections from both macOS and Windows clients. IMAP works perfectly fine.
The Problem:
All DAV sync attempts fail with an XML parsing error at position 4733:
- Outlook CalDAV Synchronizer (Windows): XML line 4733 error
- eM Client (macOS):
System.Xml.XmlException: Xml_MessageWithErrorPosition, Xml_UnexpectedTokenEx, 2, 4733
- Apple Contacts/Calendar (macOS): Connection fails (likely same root cause)
What I’ve tried:
- Base URL:
https://mail.server.com/SOGo/dav/user@domain.com/
- Full calendar URL:
https://mail.server.com/SOGo/dav/user@domain.com/Calendar/personal/
- Both attempts produce the same error
Additional context:
- Fresh mailcow installation (2025-12) with SOGo 5.12.4
- Empty calendars/contacts (no imported data yet)
- Thunderbird partially works (contacts sync, but calendars don’t appear)
- Server logs show successful PROPFIND requests (HTTP 207), so authentication works
Is this a known issue with SOGo 5.12.4, or am I missing something in the configuration? Happy to provide additional logs or config files if needed.
Thanks in advance!
SOLVED - XML Parse Errors Caused by Email Aliases with Ampersands
I found the root cause of my CalDAV/CardDAV synchronization issues!
The Problem:
Email aliases containing an ampersand character (e.g., user&name@domain.com) were causing SOGo to return invalid XML responses. The & wasn’t being properly escaped as & in the XML output, which caused all DAV clients with strict XML parsers to fail with errors like:
Xml_UnexpectedTokenEx at position 4733 (eM Client)
Xml_MessageWithErrorPosition (Outlook CalDAV Synchronizer)
- XML parsing failures (Apple clients and others)
Why curl tests appeared to work:
Curl simply displays raw XML without parsing it, so manual PROPFIND tests didn’t reveal the issue. The problem only became visible when specifically requesting calendar-user-address-set properties, which exposed the un-escaped & characters in mailto: URIs.
The Solution:
- Remove or rename all email aliases containing
& characters in Mailcow
- Use alternatives like
-, ., or + instead (e.g., user-name@domain.com)
- Restart SOGo:
docker compose restart sogo-mailcow
- Verify the XML is now valid with a PROPFIND test
- Reconfigure your DAV clients
Result:
All clients now sync perfectly - eM Client, Outlook CalDAV Synchronizer, Apple Calendar/Contacts, and Thunderbird all work flawlessly.
Technical note:
While RFC 5322 technically allows & in the local part of email addresses, SOGo doesn’t properly escape it when generating XML responses, causing this issue. This appears to be a SOGo bug rather than a mailcow configuration problem.
Hope this helps anyone else encountering similar XML parsing errors with CalDAV/CardDAV!