Mavericks has an application called Contacts. Mavericks Server (OS X Server 3) has a service called Contacts. While the names might imply differently, surprisingly the two are designed to work with one another. The Contacts service is based on CardDAV, a protocol for storing contact information on the web, retrievable and digestible by client computers. However, there is a layer of Postgres-based obfuscation between the Contacts service and CalDAV. The Contacts service is also a conduit with which to read information from LDAP and display that information in the Contacts client, which is in a way similar to how the Global Address List (GAL) works in Microsoft Exchange.
I know I’ve said this about other services in OS X Server, but the Contacts service couldn’t be easier to configure. First, you should be running Open Directory and you should also have configured Apple Push Notifications. To setup Push Notifications, have an Apple ID handy and click on the Contacts entry in the SERVICES section of Server app.
Click the Edit button to configure the Apple Push Notification settings for the computer. When prompted, click on Enable Push Notifications.
If prompted, provide the username and password for the Apple ID and then click on Finish.
To enable the Contacts service, open the Server app and then click on Contacts in the SERVICES section of the List Pane. From here, use the “Include directory contacts in search” checkbox to publish LDAP contacts through the service, or leave this option unchecked and click on the ON button to enable the service.
The Contacts service then starts and once complete, a green light appears beside the Contacts entry in the List Pane. To configure a client open the Contacts application on a client computer and use the Preferences entry in the Contacts menu to bring up the Preferences screen. From here, click the Accounts menu and then click on Add Accounts.
At the Add Account screen, click Other contacts account.
At the “Add a CardDAV Account” screen, select CardDAV from the Account type field and then provide a valid username from the users configured in Server app as well as the password for that user and the name or IP address of the server. Then click on the Create button.
When the account is finished creating click on the Server Settings tab if a custom port is required. Otherwise, close the Preferences/Accounts screen and then view the list of Contacts. Click on the name of the server in the Contacts sidebar list. There won’t be any contacts yet, so click on the plus sign to verify you have write access to the server.
Next, let’s get access to the LDAP-based contacts. To do so, bring up the Add Account screen again and this time select LDAP from the Account Type field.
Provide the name or IP address of the server and then the port that LDAP contacts are available over (the defaults, 389 and 636 with SSL are more than likely the settings that you’ll use. Then click on the Continue button.
At the Account Settings screen, provide the name that will appear in the Contacts app for the account in the Description field and then enter the search base in the Search base field. To determine the search base, use the serveradmin command. The following command will output the search base:
sudo serveradmin settings dirserv:LDAPSettings:LDAPSearchBase
Then set Authentication to simple and provide the username and password to access the server for the account you are configuring. The list then appears.
The default port for the Contacts service is 8443, as seen earlier in the configuration of the client. To customize the port, use the serveradmin command to set addressbook settings for BindSSLPorts to edit the initial array entry, as follows:
sudo serveradmin settings addressbook:BindSSLPorts:_array_index:0 = 8443
The default location for the files used by the Contacts service is in the /Library/Server/Calendar and Contacts directory. To change that to a folder called /Volumes/Pegasys/CardDAV, use the following command:
sudo serveradmin settings addressbook:ServerRoot = "/Volumes/Pegasys/CardDAV"
The service is then stopped with the serveradmin command:
sudo serveradmin stop addressbook
And started with the serveradmin command:
sudo serveradmin start addressbook
And whether the service is running, along with the paths to the logs can be obtained using the fullstatus command with serveradmin:
sudo serveradmin fullstatus addressbook
The output of which should be as follows:
addressbook:setStateVersion = 1
addressbook:logPaths:LogFile = "/var/log/caldavd/access.log"
addressbook:logPaths:ErrorLog = "/var/log/caldavd/error.log"
addressbook:state = "RUNNING"
addressbook:servicePortsAreRestricted = "NO"
addressbook:servicePortsRestrictionInfo = _empty_array
addressbook:readWriteSettingsVersion = 1
If you’re easily amused, run the serveradmin settings for calendar and compare them to the serveradmin settings for addressbook:
sudo serveradmin settings calendar
By default, the addressbook:MaxAllowedInstances is 3000. Let’s change it for calendar:
sudo serveradmin serveradmin settings calendar:MaxAllowedInstances = 3001
And then let’s see what it is in addressbook:
serveradmin settings addressbook:MaxAllowedInstances
krypted October 23rd, 2013
Posted In: Mac OS X Server
Address Book Server, caldav, carddav, Contacts Server, full status, LDAP, Mac Server, Mavericks Server, mavserver, OS 10.9 Server, OS X Server, server 2.2, server 3, serveradmin, twisted