No contacts sync with MacOS and IMAP user backend
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
- Login with IMAP credentials and copy contacts URI from contacts app in NextCloud
- Create a new Carddav account in MacOS. Type: manual, User/password: IMAP credentials, Serveraddress: pasted from previous step.
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):
"PROPFIND /nextcloud/remote.php/dav/addressbooks/users/**imapuser%
40example.com**/contacts/ HTTP/1.1" "-" "Mac OS X/10.13.3 (17D102) AddressBook/1808.6"
Nextcloud sync Client (working):
"PROPFIND /nextcloud/remote.php/dav/files/**[email protected]**/ HTTP/1.1" "-" "Mozilla/5.0 (Macintosh) mirall/2.3.3 (build 84) (Nextcloud)"
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/[email protected]/contacts/'
Alias '/nextcloud/remote.php/dav/principals/users/imapuser%40example.com/contacts/' 'https://example.com/nextcloud/remote.php/dav/principals/users/[email protected]/contacts/'
... 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:
No errors have been found.
List of activated apps:
Enabled:
- activity: 2.6.1
- bruteforcesettings: 1.0.3
- calendar: 1.6.1
- caniupdate: 0.1.2
- comments: 1.3.0
- contacts: 2.1.3
- dav: 1.4.6
- federatedfilesharing: 1.3.1
- federation: 1.3.0
- files: 1.8.0
- files_pdfviewer: 1.2.1
- files_sharing: 1.5.0
- files_texteditor: 2.5.1
- files_trashbin: 1.3.0
- files_versions: 1.6.0
- files_videoplayer: 1.2.0
- firstrunwizard: 2.2.1
- gallery: 18.0.0
- logreader: 2.0.0
- lookup_server_connector: 1.1.0
- nextcloud_announcements: 1.2.0
- notifications: 2.1.2
- oauth2: 1.1.0
- password_policy: 1.3.0
- piwik: 0.3.2
- provisioning_api: 1.3.0
- quota_warning: 1.2.0
- ransomware_protection: 1.1.0
- serverinfo: 1.3.0
- sharebymail: 1.3.0
- socialsharing_email: 1.0.3
- survey_client: 1.1.0
- systemtags: 1.3.0
- theming: 1.4.1
- twofactor_backupcodes: 1.2.3
- updatenotification: 1.3.0
- user_external: 0.4
- workflowengine: 1.3.0
Disabled:
- admin_audit
- encryption
- external
- files_external
- keeweb
- radio
- user_ldap
Nextcloud configuration:
{
"system": {
"maintenance": false,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***\/nextcloud",
"dbtype": "mysql",
"version": "13.0.1.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "php",
"mail_smtpauthtype": "LOGIN",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"memcache.local": "\\OC\\Memcache\\APCu",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"memcache.locking": "\\OC\\Memcache\\Redis",
"user_backends": [
{
"class": "OC_User_IMAP",
"arguments": [
"{***REMOVED SENSITIVE VALUE***:993\/imap\/ssl\/novalidate-cert\/readonly}INBOX"
]
}
],
"lost_password_link": "disabled",
"trashbin_retention_obligation": "7,30",
"log_rotate_size": "52428800",
"enabledPreviewProviders": [
"OC\\Preview\\BMP",
"OC\\Preview\\GIF",
"OC\\Preview\\JPEG",
"OC\\Preview\\MarkDown",
"OC\\Preview\\MP3",
"OC\\Preview\\PNG",
"OC\\Preview\\TXT",
"OC\\Preview\\XBitmap",
"OC\\Preview\\PDF",
"OC\\Preview\\Postscript",
"OC\\Preview\\SVG",
"OC\\Preview\\TIFF",
"OC\\Preview\\Movie"
],
"theme": "",
"loglevel": 2
}
}
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
"PROPFIND /nextcloud/remote.php/dav/addressbooks/users/**imapuser%
40example.com**/contacts/ HTTP/1.1" "-" "Mac OS X/10.13.3 (17D102) AddressBook/1808.6"
Nextcloud log (data/nextcloud.log)
nothing related
Browser log
nothing related
strange, can you confirm this issue is still present in 14.0.0 or above?
if so, @MarvAmBass could you take a look at this?
possibly related to #18