Skip to content
Use HTTP and DNS to provide MX server configuration profiles to native mail clients like Outlook and Thunderbird.
Branch: master
Clone or download
This branch is even with gronke:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

E-Mail Autoconfigure

Some E-Mail clients gather configuration information before setting up mail accounts. This project allows to provide clients like Outlook and Thunderbird the proper mail server configuration, so that users can simply enter their email and password to setup a new mail account.


Apache Webserver

You need an Apache webserver with PHP5 preconfigures. You can then configure your Virtual Host like this

<VirtualHost *:443>
  ServerName autodiscover.{{$DOMAIN}}
  ServerAlias autodiscover.{{$DOMAIN}} autoconfig.{{$DOMAIN}}

  <Location />
    Options -Indexes
    AllowOverride All


Now copy settings.json.sample to your Virtual Host directory root and apply your configuration variables.

Autoconfig for multiple domains on the same server

When a user puts his E-Mail address into his mail client, it will probably do a GET request on

If you have multiple domains hosted on your mailserver, you can redirect those requests to your main-autoconfig server. Add this configuration to your existing Virtual Host configuration:

<VirtualHost *:443>
  SSLEngine On

  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^autodiscover\. [NC]
  RewriteRule ^/(.*)      https://autodiscover.{{$DOMAIN}}/$1 [L,R=301,NE]

  RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
  RewriteRule ^/(.*)      https://autoconfig.{{$DOMAIN}}/$1 [L,R=301,NE]

<VirtualHost *:80>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^autodiscover\. [NC]
  RewriteRule ^/(.*)      https://autodiscover.{{$DOMAIN}}/$1 [L,R=301,NE]

  RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
  RewriteRule ^/(.*)      https://autoconfig.{{$DOMAIN}}/$1 [L,R=301,NE]

DNS Setup

For the case you are using Bind and have the autoconfig HTTP server running on the same IP your www. subdomain resolves to, you can use this DNS records to configure your nameserver

autoconfig              IN      CNAME   www
autodiscover            IN      CNAME   www

@                       IN      MX 10   {{$MX_DOMAIN}}.
@                       IN      TXT     "mailconf=https://autoconfig.{{$DOMAIN}}/mail/config-v1.1.xml"
_imaps._tcp             SRV 0 1 993     {{$MX_DOMAIN}}.
_submission._tcp        SRV 0 1 465     {{$MX_DOMAIN}}.
_autodiscover._tcp      SRV 0 0 443     autodiscover.{{$DOMAIN}}.

Instead of a CNAME, you can of course also choose an A-record

autoconfig              IN      A      {{$AUTODISCOVER_IP}}
autodiscover            IN      A      {{$AUTODISCOVER_IP}}

Replace above variables with data according to this table

Variable Description
MX_DOMAIN The hostname name of your MX server
DOMAIN Your apex/bare/naked Domain


  • Allow other authentication methods (currently always required)
  • Support nginx HTTP server
  • Add client support table
  • Create a Makefile for easy installation
You can’t perform that action at this time.