Autodiscover

## MS-ASCMD ( ActiveSync Command Reference Protocol Specification )

#### Microsoft Specifications

* [Autodiscover Command](http://msdn.microsoft.com/en-us/library/ee178639.aspx)
* [Protocol Examples](http://msdn.microsoft.com/en-us/library/ee159670.aspx)

#### Overview

The Autodiscover feature allow the automatic setting up of a OBM user account on its phone.

The pattern of a "Autodiscover" request is :


chris@woodgrovebank.com

http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responsesc...

The pattern of a "Autodiscover" response is :



fr:fr

chris@woodgrovebank.com




MobileSync
https://as.woodgrovebank.com/Microsoft-Server-ActiveSync
https://as.woodgrovebank.com/Microsoft-Server-ActiveSync


CertEnroll
https://as.woodgrovebank.com/Microsoft-Server-ActiveSync
CertEnrollTemplate




## Installation

#### For a default installation
The Autodiscover feature is installed and configured automatically when you do an installation "from scratch", you can use it out of the box without any other configuration.

#### For an OBM installation update

In case of installation update, you need to add the autodiscover configuration yourself. Don't panic, it's quite easy !

You have to modify the apache configuration of OBM in : /etc/apache2/sites-available/obm.conf

   ProxyPass /Microsoft-Server-ActiveSync http://_YOUR_OPUSH_SERVER_:8082/opush/ActiveSyncServlet/ # Should already be there
   ProxyPassReverse /Microsoft-Server-ActiveSync http://_YOUR_OPUSH_SERVER_:8082/opush/ActiveSyncServlet/ # Should already be there
   ProxyPassMatch (?i:/autodiscover) http://_YOUR_OPUSH_SERVER_:8082/opush/Autodiscover/ # To add
   ProxyPassReverse /autodiscover http://_YOUR_OPUSH_SERVER_:8082/opush/Autodiscover/ # To add

## Configuration

#### Opush

* The 'external-url' key in /etc/obm/obm_conf.ini is used by Autodiscover. This key is the address of our Exchange ActiveSync server (opush in our case) sent in Url and Name tags response.
* OBM configuration in Apache (/etc/apache2/sites-available/obm.conf) must be configured for SSL

    [...]
    [global]
    title=OBM
    external-url=YOUR_OPUSH_SERVER
    [...]

* Two apache redirections should also be present in /etc/apache2/sites-available/obm.conf

    ProxyPass /Microsoft-Server-ActiveSync http://_YOUR_OPUSH_SERVER_:8082/opush/ActiveSyncServlet/
    ProxyPassReverse /Microsoft-Server-ActiveSync http://_YOUR_OPUSH_SERVER_:8082/opush/ActiveSyncServlet/
    ProxyPassMatch (?i:/autodiscover) http://_YOUR_OPUSH_SERVER_:8082/opush/Autodiscover/
    ProxyPassReverse /autodiscover http://_YOUR_OPUSH_SERVER_:8082/opush/Autodiscover/

#### DNS

When you try to add a Exchange ActiveSync account on your smartphone, you have set the user e-mail address.

The domain part of the e-mail will be used to find the targer server.

It's necessary to have a DNS server configured to help the phone to resolv this domain.

Some phones prefix the domain by 'autodiscover.'. So it's mandatory to add to your DNS configuration those both entries :

YOUR_DOMAINE A YOUR_OPUSH_SERVER_IP
autodiscover.YOUR_DOMAINE A YOUR_OPUSH_SERVER_IP

.. some job for the reverse DNS part :

YOUR_OPUSH_SERVER_IP A YOUR_DOMAINE
YOUR_OPUSH_SERVER_IP A autodiscover.YOUR_DOMAINE

#### PDA

Autodiscover feature allow phones to find by themselves the correct configuration to use for an user account.

This feature involves that the communication between the phone and the server is on a secure channel.

Even if that could work without any certificate depending of the phone used, most of time a certificate is needed :

##### Case 1, you have a certificate signed by a trusted authority

You have nothing to do, Autodiscover should work directly.

##### Case 2, you have a self-signed certificate

You need to import this certificate on each phones on which you will use Autodiscover.
For that, thanks to refer to the phone's documentation.

##### On the PDA

1. Into "Accounts" parameters of the PDA
2. Create an account 'Exchange ActiveSync'.
3. Configure only your e-mail et your password
4. Your phone should now be configured for your account. That's all !

## Compatibility

| PDA | ROM / Version | OK/KO |
| --- | ------------- | ----- |
| HTC SAGA SENSE 3.0 | Orange / Android 2.3.5 | OK |
| IPHONE 4 | IOS 5.1.1 | OK |
| NEW IPAD | IOS 6.0.1 | OK |
| SAMSUNG GALAXY S | Orange / Android 2.3.4 | KO |
| SAMSUNG GALAXY SII | Orange / Android 4.0.3 | KO |
| SAMSUNG GALAXY SII | Orange / Android 2.3.3 | Not implemented by the phone |
| SAMSUNG OMNIA 7 | Windows phone 7.5 | KO |
| SAMSUNG B7350 | Windows phone 6.5 | KO | Air Max 1