Setup The Contacts Server In OS X Server 5

OS X has an application called Contacts. OS X Server 5, running on Yosemite or El Capitan, has a service called Contacts. While the names might imply very different things that they do, you’ll be super-surprised that 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 CardDAV. 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. Screen Shot 2015-09-10 at 8.13.53 AM Click the Edit Notifications button to configure the Apple Push Notification settings for the computer. When prompted, click on Enable Push Notifications. Screen Shot 2015-09-10 at 8.15.49 AM 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. Screen Shot 2015-09-10 at 8.19.12 AM 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. Screen Shot 2015-09-10 at 8.19.36 AM At the Add Account screen, scroll down and click Add Other Account… to bring up an expanded menu of account types. Screen Shot 2015-09-10 at 8.20.32 AM Click Add a CardDAV account. Screen Shot 2015-09-10 at 8.21.10 AM At the “Add a CardDAV Account” screen, enter the email address and password of the user. Auto discovery doesn’t always work, so you might end up using the manual button to add the account using the server’s address. Alternatively, if you’ve mapped CardDAV to custom ports, you may use the advanced option to have paths and ports available. Screen Shot 2015-09-10 at 8.24.03 AM When the account is finished creating, you can click on the account again to see the settings used. Otherwise, close the Preferences/Accounts screen and then view the list of Contacts. Click on View and then Show Groups. This will show you the name of the servers that you’re connected to in the sidebar. There won’t be any contacts yet, so click on the plus sign to verify you have write access to the server. Screen Shot 2015-09-10 at 8.27.44 AM 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 Account from the Account Type field. Screen Shot 2015-09-10 at 8.29.02 AM 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 /Applications/ 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 /Applications/ settings addressbook:SSLPort = 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 /Applications/ settings addressbook:ServerRoot = "/Volumes/Pegasys/CardDAV" When changing the ServerRoot, you’ll likely need to change the DataRoot, which is usually the Data directory immediately underneath the ServerRoot. To do so, run serveradmin and put the DataRoot entry under the addressbook settings: sudo /Applications/ settings addressbook:DataRoot = "/Volumes/Pegasys/CardDAV/Data" The service is then stopped with the serveradmin command: sudo /Applications/ stop addressbook And started with the serveradmin command: sudo /Applications/ 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 /Applications/ fullstatus addressbook The output of which should be as follows: status addressbook addressbook:state = “RUNNING” addressbook:setStateVersion = 1 addressbook:readWriteSettingsVersion = 1 If you’re easily amused, run the serveradmin settings for calendar and compare them to the serveradmin settings for addressbook: sudo /Applications/ settings calendar By default, the Contacts server allows basic authentication. We’ll just turn that off real quick: sudo /Applications/ settings addressbook:Authentication:Basic:Enabled = no And then let’s see what it is in addressbook: /Applications/ settings addressbook:Authentication:Basic:Enabled

4 thoughts on “Setup The Contacts Server In OS X Server 5”

  1. I added pictures to the user accounts on the server thinking they would show up via the contacts service but they don’t, do you know a way of getting this to work?

  2. Is there a way to limit the users’ search scope? I’m hosting a few different domains and would like to enable searching as configured under the contacts server configuration window in server manager, but I’d like to limit a user, when searching via the contacts app in iOS (or any contact client app), to only receive a list matching users in same security groups.

Comments are closed.