mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14.05k stars 1.44k forks source link

Nextcloud caldav carddav url change prevents syncing to roundcube #1918

Open vikingmedia opened 3 years ago

vikingmedia commented 3 years ago

in the install script of MIAB 0.52 I've noticed, that the carddav url in roundcube is set to https://{domain}/cloud/remote.php/carddav/addressbooks/%u/contacts

<?php
/* Do not edit. Written by Mail-in-a-Box. Regenerated on updates. */
$prefs['_GLOBAL']['hide_preferences'] = true;
$prefs['_GLOBAL']['suppress_version_warning'] = true;
$prefs['ownCloud'] = array(
     'name'         =>  'ownCloud',
     'username'     =>  '%u', // login username
     'password'     =>  '%p', // login password
     'url'          =>  'https://{domain}/cloud/remote.php/carddav/addressbooks/%u/contacts',
     'active'       =>  true,
     'readonly'     =>  false,
     'refresh_time' => '02:00:00',
     'fixed'        =>  array('username','password'),
     'preemptive_auth' => '1',
     'hide'        =>  false,
);
?>

in nextcloud, the url is https://{domain}/cloud/remote.php/dav/addressbooks/users/{user_id}/contacts/ however. I've tried to access https://{domain}/cloud/remote.php/carddav/addressbooks/users/{user_id}/contacts/ in nextcloud, but the route doesn't seem to be working:

image

xenithorb commented 3 years ago

For what it's worth the "ownCloud" section in RoundCube contacts has never worked for me, I wasn't even sure if they implemented a config for that.

Even when you go to create a new contact under "ownCloud (Contacts)" it just errors out in roundcube with:

==> /var/log/roundcubemail/carddav.warn.log <==
[19-Mar-2021 11:46:25 -0400]: <urbsotar> BACKEND: (get_record_from_carddav) Request for VCF 'B187B588-4D9A-453E-A0E6-09D690262691.vcf' which doesn't exist on the server.
[19-Mar-2021 11:46:42 -0400]: <urbsotar> BACKEND: (get_record_from_carddav) Request for VCF '00F399A9-ABC4-4ADD-B31C-4A9BC3F6387C.vcf' which doesn't exist on the server.

You are probably correct that the generated config's DAV URI is probably not correct and maybe hasn't been for quite some time?

I changed the url param to be what Nextcloud now shows in the contacts app, and it still didn't work :disappointed:

kiekerjan commented 3 years ago

Indeed, if I use 'url' => 'https://<domain>/cloud/remote.php/dav/addressbooks/users/%u/contacts/', instead of 'url' => 'https://<domain>/cloud/remote.php/carddav/addressbooks/%u/contacts',

in /usr/local/lib/roundcubemail/plugins/carddav/config.inc.php, my roundcube address book works better.

xenithorb commented 3 years ago

Does it? Am I the odd man out here? I was under the impression "ownCloud" contacts in RoundCube mail don't work at all?

kiekerjan commented 3 years ago

Well, it does work a little bit. But it seems I was too enthousiastic. I saw the same error you're having a while ago, and with the updated url it was gone. However, now it's back, so still not working too well.

kiekerjan commented 3 years ago

It seems that mail-in-a-box uses the roundcube carddav plugin version 3.0.3 from 2018. I see there's a newer version at https://github.com/mstilkerich/rcmcarddav 4.1.1. I've installed that and I'll see how that goes, so far, so good.

Note: I gather from the changelog that the database scheme has been changed for version 4. So if you install the new version, it won't be possible to downgrade back to version 3.

kiekerjan commented 3 years ago

Seems to work fine until now. However, I'm not a heavy user of the address book, so more testing would be needed before merging this.