My test results to make carddav work on surgemail:
Copy php script:
copy C:\surgemail\phplib\netwin\abk.php \surgemail\scripts
Create data file: Script points to data\abkdb.sqlite (in same schema as caldb.sqlite) so either create empty suitable formatted database:
copy C:\surgemail\phplib\netwin\data\caldb.sqlite \surgemail\scripts\data\abkdb.sqlite
or point script at caldb.sqlite instead. This means the contacts info and calendar info is stored in same db file, which with the current surgemail setup means that carddav data is copied to the mirror server once a day too (as is the case currently with caldav entries)
Add settings to surgemail.ini:
g_url_alias from="/abk" to="/scripts/abk.php"
g_url_redirect from="/.well-known/carddav" to="/abk"
On iPhone / iPad (tested iOS 6) or OSX 10.7 connect to the server as:
username:HIDDEN@domain.com
password: your_pass
server: url or ip address of the server (eg for my test 192.168.0.10)
All above just confirmed to work on a default install of latest surgemail version..
Two other items:
1) If your client needs full carrdav url I believe it is much the same as caldav. So for carddav I believe:
http://server.name.com:7080/abk/principals/user%40domain.com
2) In terms of enforced SSL, the same holds for carddav as caldav. ie if you are enforcing ssl through the use of surgemail.ini: g_ssl_require "*" you would currently need to modify this line in surgemail/phplib/netwin/NWAuth_sabre.php from "/notls" to "/ssl/novalidate-cert":
$imap = imap_open("{127.0.0.1:993/ssl/novalidate-cert}INBOX", $username, $password, OP_HALFOPEN);
Although item 2 here I expect to make automatic for the next version of surgemail.
Marijn
On Friday 18/01/2013 at 9:33 am, surgemailHIDDEN@etwinsite.com wrote:
Yes, sounds like the sqlite database need tweaking. I certainly had it running with minimal effort when I was first setting up surgeweb based caldav, but there have been a few updates to sabredav since I last tried that myself and it may not be pointing at a suitably formatted sqlite file by default.
I'll run some tests, let you know when I have it running again and put together a documentation page to make the process easier for others shortly :-)
Marijn
On Friday 18/01/2013 at 7:39 am, John Wilkes wrote:
I enabled CardDAV by copying abk.php to the surgemail/scripts directory and setting the surgemail redirection rules:
g_url_alias from="/abk" to="/scripts/abk.php"
g_url_redirect from="/.well-known/carddav" to="/abk"
When I login in on the web (myserver:port/abk) I get this error message:
PDOException SQLSTATE[HY000]: General error: 1 no such table: users 1.6.2
Am I missing a standalone SQL table of CardDAV users because CardDAV functionality is not integrated with SurgeWeb yet? Do I need to do something to initialize a CardDAV users table and add myself?
The abk.log file doesn't give any interesting information:
01/17/13 18:04:58 [15976] ----
01/17/13 18:04:58 [15976] Sabre ABK
01/17/13 18:04:59 [15976] need auth beforeMethod [GET-]
01/17/13 18:04:59 [15976] NWAUTH
user=john@wilkes.com pass={hidden} hash=1c74855d13c34eb9421fcbc4d47a1192
01/17/13 18:04:59 [15976] Sabre ABK END
There is no corresponding entry in the nwauth.log file with that timestamp, so I wonder if my CardDAV login is being authenticated at all. Maybe it doesn't even try to authenticate if it can't find me in its user database? (Or in this case, doesn't have a user database...)
I'm very interested in CardDAV support and am willing to test and help debug.
John
--
John Wilkes
john@wilkes.comNeither major party is interested in decreasing the size of government; they
merely wish to argue about how it should expand. --Jake Diliberto