Working Outlook Autodiscover for use with TLS

Since I could find nothing in the forums with the details on how to get Outlook to use TLS instead of SSL for outbound SMTP, I though I would share my working Autodiscover XML that works every time.

The key is to remove the SSL line and add tls

<?xml version="1.0" encoding="utf-8" ?> email settings IMAP 24 $IMAP_HOST $IMAP_PORT $SMTP_LOGIN off $IMAP_SSL on SMTP 24 $SMTP_HOST 587 $SMTP_LOGIN off tls on

I do note there is a bug when Virtualmin creates the autoconfig.cgi file for each domain that it sets SMTP_HOST to and IMAP_HOST to I manually edited the .cgi file to set SMTP_HOST to and everything works first time with Outlook and Autoconfiguration - especially not having to change outbound encryption from SSL to TLS manually.

THANK YOU, this was very helpful!

Do you know how to set this up to include POP3? I’ve been trying to sort it but it always uses IMAP and I prefer to use IMAP for web access and POP3 for client access. I’d appreciate any help you can give. Also, for some unknown reason, using autoconfig my inbound server is never filled when using autoconfig.

I’m going to copy and try your config above to see if that helps.


You’d need to add a POP3 type section. It’d look at lot like the IMAP section in the example above, though I don’t think we populate a POP3_PORT variable, so you’d need to manually specify it (996, I think, for TLS encrypted POP3S).

I just never seem to be able to get it to work. I know the port is 995 as I set it up manually but for some unknown reason, Outlook 2016 simply doesn’t fetch the correct information, even for the IMAP. It picks up my domain name but not the mail. domain part. Is there a way to force the autodiscover to make POP3 as a priority do you know?

USE SMTP_HOST for everything, IMAP, POP3, and SMTP as it is populated with mail.xxxx.xx, where IMAP_HOST is just xxxx.xx

Ah, ok. I’ll get that corrected on my side. Thanks.

Actually I typed this backwards… $IMAP_HOST is mail.xxxx.xx where $SMTP_HOST is xxxx.xx

If you want to see exactly, look at the file in /home/xxxx.xx/cgi-bin/autoconfig.cgi

OK. Thanks.