ZxMobile Autodiscover

From ZeXtras Suite Wiki

Jump to: navigation, search
Language: English  • español • português
ZxMobile logo box.png
Available since ZeXtras version: 1.10
Latest Version: 2.12.2
Released on: January 2nd, 2019
Compatibility List
Admin Guide
FAQ
Troubleshooting
Device List
ZspMobile logo box.png
Warning.png Warning!

This feature is available since ZeXtras Suite 1.8.10.

The Autodiscover feature

At the beginning of the account creation process on any mobile devices, the client will try to autonomously detect the URL, domain and username before asking the user for an imput.

ZeXtras Mobile provides its own Autodiscover handler in order to make this feature available in all supported version of Zimbra.

Enabling ZxMobile's Autodiscover will also allow the use of the "Mobile Password" features in Zimbra 7.x and Zimbra 6.x.

As of ZeXtras Suite 1.10.0 (and higher), the Autodiscover feature will return the value of the "zimbraPublicServiceHostname" domain property. Should such property be empty, it will fall back to the value of the "zimbraServiceHostName" server property.

The domain name is either sent explicitly by the client or deduced by the http/s request sent by the mobile phone.

Setting up Autodiscover

In order to be functional, the Autodiscover feature needs both a dedicated DNS record and a change in Jetty's configuration.

Step 1: DNS records

Two options are available:

  • DNS A record: either create a DNS A record or a DNS CNAME record for autodiscover.[yourdomain.com], whose target must be the mailserver (or the appropriate proxy in case of a multistore infrastructure). In order for SSL to be properly functional, you'll either need a wildcard SSL certificate for [yourdomain.com] or to declare "autodiscover.[yourdomain.com]" as a Certificate Subject Alt Name within your certificate.
  • DNS SRV record: create a new SRV record like the following:
Service: _autodiscover
Protocol: _tcp
Port Number: 443
Host: [mail.yourdomain.com]

Step 2: Jetty configuration

Warning.png Warning!

This changes are not guaranteed to survive a Zimbra update. Depending on the contents of the update you might need to manually re-apply this changes.

Based on your Zimbra major release, apply one of the following changes.

A restart of Zimbra's mailboxd service is needed for the new configuration to become active. You can do so by running `zmmailboxdctl restart` as the zimbra user.

Zimbra 8.0.4+

/opt/zimbra/jetty/etc/jetty.xml.in

Locate the following lines...

<Call name="addRule">
            <Arg>        
                <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
                    <Set name="pattern">/autodiscover/*</Set>
                    <Set name="replacement">/service/autodiscover</Set>
                </New>
            </Arg>
        </Call>
        <Call name="addRule">
            <Arg>
                <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
                    <Set name="pattern">/Autodiscover/*</Set>
                    <Set name="replacement">/service/autodiscover</Set>
                </New>
            </Arg>
        </Call>
        <Call name="addRule">
            <Arg>
                <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
                    <Set name="pattern">/AutoDiscover/*</Set>
                    <Set name="replacement">/service/autodiscover</Set>
                </New>
            </Arg>
        </Call>

... and replace

/service/autodiscover

with

/service/extension/autodiscover

Zimbra 8.x (v8.0.3 and older)

/opt/zimbra/jetty/etc/jetty.xml.in

Locate the following block...

<Call name="addRule">
    <Arg>
        <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
            <Set name="pattern">/Microsoft-Server-ActiveSync/*</Set>
            <Set name="replacement">/service/extension/zimbrasync</Set>
        </New>
    </Arg>
</Call>

... and add the following lines after it:

<Call name="addRule">
    <Arg>
        <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
            <Set name="pattern">/Autodiscover/*</Set>
            <Set name="replacement">/service/extension/autodiscover</Set>
        </New>
    </Arg>
</Call>
<Call name="addRule">
    <Arg>
        <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
            <Set name="pattern">/AutoDiscover/*</Set>
            <Set name="replacement">/service/extension/autodiscover</Set>
        </New>
    </Arg>
</Call>

This will redirect all possible Autodiscover calls to the correct handler.


Zimbra 7.x and 6.x

/opt/zimbra/jetty/etc/jetty.xml.in

Locate the following line...

<Call name="addRewriteRule"><Arg>/Microsoft-Server-ActiveSync/*</Arg><Arg>/service/extension/zimbrasync</Arg></Call>

... and add the following lines after it:

<Call name="addRewriteRule"><Arg>/autodiscover/*</Arg><Arg>/service/extension/autodiscover</Arg></Call>
<Call name="addRewriteRule"><Arg>/Autodiscover/*</Arg><Arg>/service/extension/autodiscover</Arg></Call>
<Call name="addRewriteRule"><Arg>/AutoDiscover/*</Arg><Arg>/service/extension/autodiscover</Arg></Call>

This will redrect all possible Autodiscover calls to the correct handler.

Personal tools