Autodiscover is a service that allows email clients to automatically determine a user’s mail server address and port from that user’s email address and password alone. This greatly simplifies a user’s setup process when attempting to connect SmarterMail to a desktop client, like Outlook and Windows Mail, as well as mobile clients on their iPhone, iPad, Android, Windows Phone and other mobile devices.
Autodiscover is supported by POP, IMAP, SMTP In, Exchange Web Services (EWS) and Exchange ActiveSync (EAS). However, not all email clients handle Autodiscover in the same way. For example, when connecting SmarterMail to mobile devices (iOS, Android, Windows, etc.), only Exchange ActiveSync connections will use Autodiscover. Outlook 2007 and above will return only IMAP connections. The Windows 8 email client will return Exchange ActiveSync, and while Thunderbird does not support Autodiscover at all, it will make the best effort to connect to any mail server. Because each client handles Autodiscover differently, it’s important to review the support documentation of your users’ preferred email client(s) to learn the connection type that’s best suited.
NOTE: Utilizing Autodiscover with Exchange Web Services or Exchange ActiveSync requires encryption over SSL or TLS. Therefore, port 443 MUST be available and not blocked by a firewall. For instructions on this configuration, please see Configure SSL/TLS to Secure SmarterMail
To configure Autodiscover for a SmarterMail domain, the following must be done by a SmarterMail Administrator:
- Configure the domain’s Autodiscover settings within SmarterMail
- Create an A Record for the domain in your DNS configuration
- Create an SRV Record for the domain in your DNS configuration
- Create an IIS binding for Autodiscover on the SmarterMail server
Configure the Domain’s Autodiscover Settings within SmarterMail
Follow these steps to adjust the protocols enabled for Autodiscover and the ports on which they listen:
- Log into SmarterMail as a System Administrator.
- Click on the Manage icon. In the Domains section, click on a domain to open its configuration settings.
- On the Options card, ensure the correct Hostname is entered. The hostname is the URL that will be returned when users attempt to connect to their email client. The most common hostname for a mail URL is “mail.yourdomain.com”.
- On the Autodiscover card, adjust the configuration options as needed. Here, you can enable or disable specific protocols from returning Autodiscover results. When a protocol is enabled for Autodiscover, clicking on that protocol’s settings cog will open a window where the encryption type and port can be adjusted. (EAS and EWS require encryption over SSL/TLS and this configuration cannot be modified.) NOTE: If a user has POP disabled for their account, their POP Autodiscover request will not be fulfilled, even if POP is enabled for Autodiscover. This applies to all protocols in their account's Service Access settings.
Modifying the Default XML Response (optional)
NOTE: The Override Desktop XML and Override Mobile XML options should NOT be modified without advanced knowledge of the XML responses used with Autodiscover. Adjusting the custom XML incorrectly can result in invalid responses returned meaning users will be unable to connect to their email client(s).
Administrators with advanced Autodiscover knowledge can override the default XML response that is sent from the domain when Autodiscover is requested. There are two types of Autodiscover responses that can be modified: Mobile XML and Desktop XML. The mobile XML response is strictly used with Exchange ActiveSync. The desktop XML response is used with everything else, including IMAP, POP, SMTP In and Exchange Web Services.
Follow these steps to override the desktop or mobile XML response sent by SmarterMail:
- Enable Override Desktop XML or Override Mobile XML.
- Click on the textbox that appears for Custom Desktop XML or Custom Mobile XML.
- In the textbox window that appears, clicking on Generate will show the XML response that SmarterMail would normally send on an Autodiscover request. You can generate this response to make adjustments as needed, or simply enter the XML response you would like to use.
- NOTE: If you turn on an override but never save any custom XML, SmarterMail will use the default protocol settings. However, if the override is turned on, ANY text you save to the Custom XML area will be used for the Autodiscover response. If you save custom text, then later remove that text and save a blank entry, Autodiscover will send a blank response. Therefore, it is imperative that you only enable the override and enter custom Autodiscover XML if you are absolutely sure what you're using is correct.
Other items to note:
- You can adjust the XML reply as needed. However, don’t remove or modify the variables, such as %EmailAddress%, %Base64EmailAddress%, or %DisplayName%, since these are used to identify the user making the Autodiscover request. (%Base64EmailAddress% is used in SmarterMail version 17.x and higher.)
- Any changes made to the XML response should be within the RFC guidelines, though this is not validated by SmarterMail.
Create an A Record for the Domain in your DNS configuration
For Autodiscover to work, each domain needs an A Record for "autodiscover.yourdomain.com" that points to the IP address of your mail server. For example, for SmarterTools, we set up an A Record for "autodiscover.smartertools.com" that points to the IP address of our mail server (mail.smartertools.com). In our DNS, the line in our zone file for this A Record looks like this:
autodiscover IN A 126.96.36.199
There are many ways to manage DNS for a domain, as well as many DNS services that can be used, so providing step-by-step instructions on this configuration is difficult. However, adding a record should be fairly straightforward. If you have questions, contact your IT professional, hosting provider or DNS provider for assistance.
Create an SRV Record for the Domain in your DNS configuration
Next, you'll want to create an SRV record for your domain. This SRV Record will return the available domain and service (SMTP, POP or IMAP) to the email client requesting Autodiscovery. Technically, setting up an SRV Record is an optional step; however, it is highly recommended as a backup to ensure Autodiscover works properly.
The SRV Record that is created should be in the following format and return the root URL of your email server:
There are many ways to manage DNS for a domain, as well as many DNS services that can be used, so providing step-by-step instructions on this configuration is difficult. Please check with your IT professional, hosting provider or DNS provider for instructions on configuring an SRV Record for your environment. The following example details the SRV configuration for SmarterTools:
Verify the SRV via NSLookup (optional)
Follow these settings to verify that you have set up the SRV Record correctly:
- On a Windows machine, open the Command Prompt and do the following:
- Type NSLOOKUP and press ENTER.
- Type set type=srv and press ENTER.
- Type _autodiscover._tcp.yourdomain.com, where "yourdomain.com" is the name of your domain, and press ENTER.
In return, you should get something similar to what's shown below, with the IP addresses and server URLs matching what you have set up for your mail server. If your results differ or no results are returned, please review your DNS configuration. It's possible the issue is caused due to DNS caching or replication.
_autodiscover._tcp.your-domain.com SRV service location:
priority = 0
weight = 0
port = 443
svr hostname = mail.your-domain.com
mail.your-domain.com internet address = 127.0.0.2
Create an IIS binding (Host Header) for Autodiscover on the SmarterMail Server
In IIS, a host header for Autodiscover should be added to your SmarterMail website that points your Autodiscover A Record to your SmarterMail installation. For example, for SmarterTools, we have an IIS binding that binds port 80 and 443 to "autodiscover.smartertools.com." This is added in addition to the IIS binding for "mail.smartertools.com", which is the URL used for setting up email clients and accessing the web interface.
If your SmarterMail installation is on a * binding and listens for any host header, you'll just need to add the necessary DNS records. However, if host headers are used for each domain, a host header must be added for each domain for both Autodiscover as well as webmail.
To learn how to configure a host header in IIS, please review Microsoft’s documentation or our KB article, Set up Hosted Headers
After this step, users can sync their SmarterMail account to an email client that supports Autodiscover using only their email address and password. SmarterMail will take care of the rest!