Outlook Autodiscover - ISPConfig

Discussion in 'Plugins/Modules/Addons' started by Trimilur, Mar 22, 2021.

  1. Trimilur

    Trimilur Member

    Hi there,
    i do have a problem with outlook autodiscover. I am using ISPAutomail https://schaal-24.de/ispconfig-automail/ and i have activated the proper alias domain and the CNAME and SRV DNS Records and the Plugin itself. It Works for Windows 10 Mail, Thunderbird etc. but not for Outlook 365. The CTRL + Autoconfugre Test Setting in Outlook itself correctly discover the XML Information though the automatic configuration doesnt work.

    The XML Information is:

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
    3. <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
    4. <Account>
    5. <AccountType>email</AccountType>
    6. <Action>settings</Action>
    7. <Protocol>
    8. <SSL>on</SSL>
    9. <Type>IMAP</Type>
    10. <LoginName>***@****.de</LoginName>
    11. <Server>server1.***.de</Server>
    12. <Port>993</Port>
    13. <SPA>on</SPA>
    14. <AuthRequired>on</AuthRequired>
    15. <DomainRequired>on</DomainRequired>
    16. </Protocol>
    17. <Protocol>
    18. <SSL>on</SSL>
    19. <Type>POP3</Type>
    20. <LoginName>***@***.de</LoginName>
    21. <Server>server1.***.de</Server>
    22. <Port>995</Port>
    23. <SPA>on</SPA>
    24. <AuthRequired>on</AuthRequired>
    25. <DomainRequired>on</DomainRequired>
    26. </Protocol>
    27. <Protocol>
    28. <UsePOPAuth>on</UsePOPAuth>
    29. <SSL>off</SSL>
    30. <Encryption>TLS</Encryption>
    31. <Type>SMTP</Type>
    32. <LoginName>***@***.de</LoginName>
    33. <Server>server1.***.de</Server>
    34. <Port>587</Port>
    35. <SPA>on</SPA>
    36. <AuthRequired>on</AuthRequired>
    37. <DomainRequired>on</DomainRequired>
    38. </Protocol>
    39. </Account>
    40. </Response>
    41. </Autodiscover>
    but automatic configuration doenst work for Outlook on PC and Mac. It does work for the main domain in the App (iOS) though but not for the customer domain.

    https://testconnectivity.microsoft.com says:
    AutoDiscoverer Settings found BUT
    No AccountSettings where given.

    The DNS Records as excpected by RFC 6186 are also set.

    https://docs.microsoft.com/de-…ted-autodiscover-behavior doesnt help as well cause I basically do not have any subkeys in the Registry.

    Could you help me?

    Outlook 365
    ISPCONFIG 3.2.3
    Apache, Debian 10
    Windows 10
    Last edited: Mar 22, 2021
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Please post in english on this forum, or use the forum on howtoforge.de.
    From my limited knowledge of German, I think I understand the problem.
    Outlook changed their mechanism to autodiscover settings. It was quite some work for Florian to change the automail module, so this has not been done so far. The module is not developed by us and therefore I can't tell you much more.
  3. Trimilur

    Trimilur Member

    @Th0m sorry i tried to translate the post.

    So I guess the basic answer is: The Automail plugin is currently just not rdy for the new discovery of Outlook 365? Do you have any idea what i could do now?
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes, that's the case. Users will have to set up their accounts manually.
    Maybe @florian030 can tell you more - he is the maintainer of this plugin.
    Trimilur likes this.
  5. Trimilur

    Trimilur Member

    Ok thank you for the quick response. I hope there is another solution than manual setup cause this is honestly exactly what i do not want.
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    There will always be email clients that don't support the automatic setup, so some people will have to set it up manually.
  7. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    newer outlook version use a different way to get the config and i will not update the plugin.
    Th0m likes this.
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Out of curiosity, what exactly has changed?
  9. Trimilur

    Trimilur Member

    I already tried to find some information about the changes without success. maybe you or other people here in the forum could help me to fix this problem, cause outlook is still more or less a popular client, so it might be a useful fix for others as well
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If the specs for Outlook autodiscover are published or someone who knows how it works is willing to contribute then autodiscover plugin could be updated. It is frustrating to code against a hidden API. Easier and more pleasant work is readily available.
  11. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    might be helpful....
    Autodiscover: Some quick methods to get it working - HowTo-Outlook (howto-outlook.com)
    Outlook 2016 implementation of Autodiscover (microsoft.com)

    another possibility, if anyone has outlook 2019, or an outlook365 account and have autodiscover working with that, if they can provide a copy of their working autodiscover.xml file (the links above contain info on finding this file) then we can compare it to the xml file returned by the automail plugin, see if they're any differences and work back from there.
    Jesse Norell and till like this.
  12. Trimilur

    Trimilur Member

    It was wrong when i wrote i do not see any log for desktop. I was just irritated by the "OutlookMobileCloudService" thought its only the mobile one

    I get the following acess logs for desktop and mobile.

    This is the Desktop client logged by my apache autodiscovery server! Using a micorosft discovery network and a foreign IP to discover the email settings set in my desktop outlook client

    [24/Mar/2021:01:55:13 +0100] "GET /autodiscover/autodiscover.json?Email=**%40***.de&Protocol=ActiveSync&RedirectCount=1 HTTP/1.1" 404 5910 "-" "OutlookMobileCloudService-Autodetect/1.0.0"


    [23/Mar/2021:22:05:46 +0100] "GET /autodiscover/autodiscover.js on?Email=***%40***.de&Protocol=ActiveSync&RedirectCount=1 HTTP/1.1" 404 5 884 "-" "OutlookMobileCloudService-Autodetect/1.0.0"
    ** - - [23/Mar/2021:22:05:46 +0100] "POST /autodiscover/autodiscover.x ml HTTP/1.1" 200 4323 "-" "-"

    The mobile app main domain do get the right mail settings at the end, the dekstop app doesnt.
    Last edited: Mar 24, 2021
  13. Trimilur

    Trimilur Member

    I found some other users with basically the same problem

    I found out by using fiddler that outlook is talking to prod-global-autodetect.acompli.net:443 so maybe this is an explantion:


    by enabling this registry key DisableOffice365SimplifiedAccountCreation the problem is ayctually gone. doesnt help me in the end though cannot force any user to put this key

    here some autodiscover functions of O365 and it differences to old version in german https://www.msxfaq.de/exchange/autodiscover/autodiscover_v2.htm
    Last edited: Mar 24, 2021
  14. Trimilur

    Trimilur Member

    So what I think is actually happening please correct me if im wrong:

    Outlook 365 Simple
    Login doesnt autodiscover by itself it actually talks to prod-global-autodetect.acompli.net:443 which then tries to autodiscover. and either it fails cause
    of wrong cached records or the records are fine and it pops up as OutlookMobileCloudService-Autodetect in the server acesslog. it then gets the correct xml (as you can see with testconnectivity microsoft i.e.) but is not able to use this information by whatever reason. The only error you can see in the connectivity test is what is display in the linked reddit post

    testresult status="Error" errorid="65e7befa-34fb-4039-9e2a-31e5fe2fcfe8" contentUrl="" testdescription="Autodiscover settings for Outlook connectivity are being validated." resultdescription="The Microsoft Connectivity Analyzer wasn't able to validate Outlook Autodiscover settings." additionaldetails="No account settings were returned from the Autodiscover response." elapsedMilliseconds="0">"

    not that helpful.

    and if you then just disable O365 Simple Login with this registry key it falls back to the old logic probably not using the outlook Mobile discovery and finds the configs correctly (proof
    Jesse Norell likes this.
  15. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    i think that's only for outlook365 / microsoft hosted exchange.
    if outlook made connections/queries like that direct to microsoft to validate for autodiscover configuration for every self hosted exchange server and self-hosted/configured autodiscover workaround/equivalent then privacy activists and law_yers (can't believe the forum won't allow a post with that word in it) would be all over it.
    Jesse Norell likes this.
  16. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    what it looks like to me is that autodiscover v1 uses xml, and autodiscover v2 uses json
    so if we edit the automail script to return the data in json format instead of xml maybe it will just work...
    i don't know it older versions of outlook have been updated that they can also use autodiscover v2, probably the script will need to check the protocol version being used and use the current xml creation script for that, and a new json creation script for v2.
  17. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Does anyone know if a domain where the new autodiscovery works? Maybe on an Exchange server or other panel? Getting a working sample would be quite useful; maybe even necessary.
  18. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    unfortunately, if soeone's using an exchange server, it doesn't look like their config will be helpful, the account types and protocol types are all completely diffferent:

    <?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">
          <DisplayName>Info - Centre Maps</DisplayName>
          <LegacyDN>/o=ExchangeLabs/ou=Exchange Administrative Group (<-random->)/cn=Recipients/cn=<-random->-info_edf9b6</LegacyDN>
          <AutoDiscoverSMTPAddress>[email protected]</AutoDiscoverSMTPAddress>
          <Protocol Type="mapiHttp" Version="1">
              <OWAUrl AuthenticationMethod="LiveIdFba, OAuth">https://outlook.office365.com/owa/</OWAUrl>
              <OWAUrl AuthenticationMethod="Fba">https://outlook.office365.com/owa/exampledomain.com/</OWAUrl>
    i don't think any of the id's were dangerous to make public, but just in case i've changed all of them to <-random-> and changed the domain name as well.

    that said, whilst looking around, i did find this, Autodiscover information for mail clients to setup pop/imap/smtp settings automatically which was updated early last year, i've not tried it yet, or had a chance to compare it's autodiscover output to what @florian030's script creates, so it might be worth taking a closer look at.
  19. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    another find suggests that additional srv records are (maybe all that's) needed:

    _imap._tcp              IN SRV  10 0 143 imap.my.server.
    _imaps._tcp             IN SRV   0 0 993 imap.my.server.
    _pop3._tcp              IN SRV  20 0 110 pop.my.server.
    _pop3s._tcp             IN SRV  10 0 995 pop.my.server.
    _smtp._tcp              IN SRV  10 0 25  smtp.my.server.
    _smtps._tcp             IN SRV   0 0 465 smtp.my.server.
    _submission._tcp        IN SRV   0 0 587 smtp.my.server.
    although that's untested so i can't confirm it works, i don't currently have access to outlook2019 or newer microsoft client to test with.
  20. Trimilur

    Trimilur Member

    .htaccess automail plugin:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule autodiscover\.xml$ /index.php [L]
    RewriteRule Autodiscover\.xml$ /index.php [L]
    RewriteRule config-v1\.1\.xml$ /index.php [L]
    <Files config.php>
    Deny from All

    .htaccess of your link

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ autodiscover.php [NC,L]
    XML of automailplugin

    <?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">

    Differences to you link: SPA off vs on AND Domain Required off vs on

Share This Page