Working Outlook Autodiscover for use with TLS

9 posts / 0 new
Last post
#1 Fri, 06/23/2017 - 11:39
pgordemer

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 <Encryption>tls</Encryption>

<?xml version="1.0" encoding="utf-8" ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
  <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
    <Account>
      <AccountType>email</AccountType>
      <Action>settings</Action>
      <Protocol>
      <Type>IMAP</Type>
        <TTL>24</TTL>
       <Server>$IMAP_HOST</Server>
        <Port>$IMAP_PORT</Port>
        <LoginName>$SMTP_LOGIN</LoginName>
        <DomainRequired>off</DomainRequired>
        <SSL>$IMAP_SSL</SSL>
        <AuthRequired>on</AuthRequired>
      </Protocol>
      <Protocol>
<Type>SMTP</Type>
        <TTL>24</TTL>
<Server>$SMTP_HOST</Server>
        <Port>587</Port>
        <LoginName>$SMTP_LOGIN</LoginName>
        <DomainRequired>off</DomainRequired>
        <Encryption>tls</Encryption>
        <AuthRequired>on</AuthRequired>
      </Protocol>
    </Account>
  </Response>
</Autodiscover>

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

Thu, 10/12/2017 - 23:50
BranhamA

THANK YOU, this was very helpful!

Fri, 10/13/2017 - 03:11
adelphia
adelphia's picture

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.

Regards

Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)

Sat, 10/14/2017 - 18:20 (Reply to #3)
Joe
Joe's picture

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).

--

Check out the forum guidelines!

Sun, 10/15/2017 - 14:18
adelphia
adelphia's picture

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?

Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)

Sun, 10/15/2017 - 19:47
pgordemer

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

Mon, 10/16/2017 - 11:37 (Reply to #6)
adelphia
adelphia's picture

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

Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)

Mon, 10/16/2017 - 12:00
pgordemer

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

Tue, 10/17/2017 - 07:34 (Reply to #8)
adelphia
adelphia's picture

OK. Thanks.

Chris: Adelphia Interactive
Desktop: Windows 10 Pro x64
Server: Ubuntu 16.0.4.2LTS
Webmin/Virtualmin: Latest (daily updates)

Topic locked