What is autoconfig and autodiscover, the related DNS records, that seems to be present in some email clients configurable using some control panels (e.g. Virtualmin and WHM)

Autoconfig and Autodiscover are lifesavers when it comes to email client software configuration.

Up to date email clients like Thunderbird and Microsoft Outlook will query a server to find out what the actual email settings are.

No more “which port”, and “what security” because, in theory, the email client will discover this itself. What bliss.

That’s why on up to date Virtualmin servers you will find these two additional DNS records on every domain:



On Virtualmin, enable it per domain like so:

virtualmin modify-mail --domain yourdomain.com --autoconfig

To enable it for all domains, do this:

virtualmin modify-dns --all-domains --add-record “autodiscover A a.b.c.d”

a.b.c.d must be the IP address of the server.

If you’re worried about creating duplicate records, you can do this beforehand:

virtualmin modify-dns --all-domains --remove-record “autodiscover A a.b.c.d”

Obviously repeat for autoconfig.

If you’re IPv6 then do this:

virtualmin modify-dns --all-domains --add-record “autodiscover AAAA a.b.c.d”

Once this is in place, you’ll end up with these website redirects:

/mail/config-v1.1.xml redirect to `/cgi-bin/autoconfig.cgi`
/.well-known/autoconfig/mail/config-v1.1.xml redirect to `/cgi-bin/autoconfig.cgi`


Now destination email clients can query for the required parameters:

http://batman.vander.host/cgi-bin/[email protected]

In the example below, you can see the standard suggested ports of 993 SSL for IMAPS and 587 STARTTLS for SMTPS


Do Apple email clients support autoconfig?

No. And that’s a reason why email provider help desks are working overtime to help Apple users. Go figure.

From the WHM documentation:

Apple® mail clients do not support AutoConfig or AutoDiscover for IMAP servers. To use AutoConfig and AutoDiscover with Apple products, your server must run Exchange rather than IMAP.


Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top