As you can see, the "@" is encoded as "%40" from the MacOS Contacts application.
So i've created these two aliases in apache:
Alias '/nextcloud/remote.php/dav/addressbooks/users/imapuser%40example.com/contacts/' 'https://example.com/nextcloud/remote.php/dav/addressbooks/users/imapuser@example.com/contacts/'
Alias '/nextcloud/remote.php/dav/principals/users/imapuser%40example.com/contacts/' 'https://example.com/nextcloud/remote.php/dav/principals/users/imapuser@example.com/contacts/'
This happens only to contacts with MacOS. Calendar sync on MacOS is working as well as contacts sync on iOS with this related account.
Steps to reproduce
Expected behaviour
MacOS downloads all existing contacts and is able to sync as expected from other carddav clients like iOS.
Actual behaviour
MacOS tries to verify the configuration and says "Username/Password could not be verified"
In the Serverlogs i noticed a difference between this carddav calls and the working calls from the Nextcloud sync application. Carddav (not working):
Nextcloud sync Client (working):
As you can see, the "@" is encoded as "%40" from the MacOS Contacts application. So i've created these two aliases in apache:
... and now it works like a charm :-) I guess we need another workaround like https://github.com/nextcloud/apps/pull/35
Server configuration
Operating system: Debian GNU/Linux 9.4 (stretch)
Web server: Apache HTTP Server 2.4.25-3+deb9u3
Database: MariaDB 10.1.26-0+deb9u1
PHP version: 7.0.27-0+deb9u1
Nextcloud version: 13.0.1
Contacts version: 2.1.3
Updated from an older Nextcloud or fresh install: Updated from OwnCloud 9.1.6 with recommended upgrade path to NextCloud 13.0.1
Signing status:
List of activated apps:
Nextcloud configuration:
Are you using external storage, if yes which one: none
Are you using encryption: no
Are you using an external user-backend, if yes which one: IMAP
Client configuration
Browser: Safari / Chrome
Operating system: MacOS High Sierra 10.13.3
CardDAV-clients: iOS and MacOS
Logs
Web server error log
Nextcloud log (data/nextcloud.log)
Browser log