mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.73k stars 1.17k forks source link

troubles with autodiscover with the new outlook 2016 assistant #615

Closed mritzmann closed 5 years ago

mritzmann commented 7 years ago

Outlook 2016 has problems with the autodiscover function of Mailcow. The old setup wizard works, the new one does not. Anybody got the same problem?


new wizard:

new_assistant

old wizard:

old_assistant

The configuration looks valid to me:

test

mkuron commented 7 years ago

Please use the old one for now. Outlook 2016 for Mac has always shown the same issue (it uses a new JSON-based autodiscover mechanism that is not documented by Microsoft and not supported by us), so I suspect they ported that to the Windows version now.

andryyy commented 7 years ago

Sounds fun.

Would love to wireshark that communication.

mritzmann commented 7 years ago

If anyone is interested in debugging: I can donate an Office365 account with Outlook 2016.

ChessSpider commented 7 years ago

quick way to open old style: in RUN C:\Program Files (x86)\Microsoft Office\root\Office16\OLCFG.EXE then button email accounts => manual setup or additional server types => Exchange ActiveSync

I had to look for this, as autoconfigure on Outlook 2016 now configures as SMTP/IMAP :(

andryyy commented 7 years ago

@mkuron Any idea why it configures as IMAP?

mritzmann commented 7 years ago

I had to look for this, as autoconfigure on Outlook 2016 now configures as SMTP/IMAP

Tested it yesterday with the old setup-assistant. Account was set up as ActiveSync. Only the new setup-assistant doesn't work.

andryyy commented 7 years ago

Strange. But it auto-configured it as IMAP?

mritzmann commented 7 years ago

automatically as activesync

mkuron commented 7 years ago

I'll test and fix it later this week. The IMAP thing is probably a user agent issue again.

andryyy commented 7 years ago

@mritzmann I meant the new config guide. :) Thanks mkuron! :)

mkuron commented 7 years ago

I haven't had any success with Outlook 2016's autoconfiguration. The OLCFG.EXE trick suggested above doesn't work for me as it always asks for my admin password and then launches as Administrator, not the user I'm running Outlook as. Even worse, when I click the "New" button, it gives me the new wizard. I am simply unable to get to the old wizard.

The new wizard leads to a single request to https://autodiscover.example.com/autodiscover/autodiscover.json?Email=user%40example.com&Protocol=ActiveSync&RedirectCount=1 with user agent OutlookMobileCloudService-Autodetect/1.0.0 -- and that request is sent by some Microsoft IP address, not the Outlook client itself. I've implemented the JSON protocol and will post a PR soon. Unfortunately though, I'm not actually able to get Outlook to properly configure the account quite yet.

If I manually create an Exchange account with the new wizard, I get the request to autodiscover.xml as in older Outlook versions, with a user agent of Microsoft Office/16.0 (Windows NT 10.0; MAPI 16.0.8431; Pro). The autodiscover.php script handles that correctly and sends ActiveSync configuration if that hasn't been disabled. Unfortunately though, Outlook fails to properly deal with the configuration it receives.

The best thing I currently have is outlook.com's reply to autodiscovery requests, e.g. at http://autodiscover.outlook.com//autodiscover/autodiscover.json?Email=test%40outlook.com&Protocol=ActiveSync&RedirectCount=1 . If you change the protocol to something else, the error message will contain a list of all supported protocols.

For now, the executive summary is: autodiscover is broken in Outlook 2016 with anything but Office 365 (even Microsoft Exchange Server appears to have trouble in many setups -- I tried two and only one worked). I can't fix it until Microsoft publishes documentation or someone reverse engineers the full protocol.

mritzmann commented 6 years ago

Hi @mkuron You dealt with it a lot in September. Thanks for that! Is there already an update? Has Microsoft published any specifications yet?

RickD123 commented 6 years ago

Hi,

does anyone have the specifications or at least a sample of the autodiscover.json file format used by Outlook? Anyone used Wireshark on this yet?

Thanks!

Kind regards RickD

mkuron commented 6 years ago

There is no public spec. https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/autodiscover-json.php is based on samples we got by querying Hotmal‘s autodiscover.json and different Exchange Server versions. It is incomplete though — it seems like either Outlook performs some extra magic during discovery, or recent Outlook/Exchange versions don’t really support autodiscovering anything but EAS and MAPI.

amaccuish commented 6 years ago

Hi. I've just been looking into this and I found a site (in german) that describes the new json protocol quite well. Here you go: https://www.msxfaq.de/exchange/autodiscover/autodiscover_v2.htm

mkuron commented 6 years ago

Thanks @amaccuish, but unfortunately it doesn't contain any information we didn't already figure out ourselves.

amaccuish commented 6 years ago

@mkuron ahh no worries. I used it for a small script that seems to work fine with office 2016, thought it could be useful :)

graczu0x0x0x0x0 commented 6 years ago

Any success on compatibility for new Outlook?

jol64 commented 6 years ago

I am also affected... autodiscovery works with Outlook 2013 but fails with Outlook 365.

andryyy commented 6 years ago

Outlook from Office 365 is shit. I doubt they even have EAS anymore. See this issue and others mentioning 365.

Shadowghost commented 6 years ago

No idea about Office 365, but with the normal Office 2016 setup wizard, Exchange seems to work fine, mails, contacts and calendar is synced. Tried it today with latest master and properly configured DNS.

jol64 commented 6 years ago

Office 365 is a trend - I got it with the Aldi convertible. I dislike the idea of switching to Thunderbird and will also have a hard time to explain my users that Office 365 cannot be used with Mailcow.

andryyy commented 6 years ago

I don't think so.

We cannot fix Outlok 365 anyway. So if you want to use EAS with Outlook, don't buy Office 365. Just use Outlook CalDav Synchronizer.

jol64 commented 5 years ago

I googled once more today and found the following interesting links: https://support.microsoft.com/en-us/help/3211279/outlook-2016-implementation-of-autodiscover https://www.msxfaq.de/exchange/autodiscover/autodiscover_v2.htm these might help to track down the issue. plus https://forum.netcup.de/administration-eines-server-vserver/vserver-server-kvm-server/p94909-office365-business-essentials-durch-mailcow-auf-rs1000-g8-ersetzen-eure-tipps/#post94909 gives a description how to manually configure a mailbox and that worked for me. Short summary; open control panel, search for mail, autoconfig will probably fail, then pick configure manually.

entr0p1 commented 5 years ago

Can confirm on the latest release of O365 (I think matches up with Office 2019) that Outlook won't allow the account to be created as an Exchange account, however going through the "Control Panel -> Mail -> Email Accounts..." and adding it from there works fine. Hope this helps.

Individuum92 commented 5 years ago

I tried Office 365 and Outlook 2016 and both dont work for me. Im new with Mailcow. Is there any fix for this issue?

andryyy commented 5 years ago

The retail Outlooks work. They have a "normal" autodiscovery and do not lack EAS.

There is no fix for something we cannot change. Don't use stupid Outlook. And don't use EAS on a desktop at all. :/

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

rsecor commented 4 years ago

Any news on this? This has been causing my clients nightmares!

andryyy commented 4 years ago

No. I don't own Outlook and don't plan to buy that crap anytime soon.

Contributions are welcome though.

mathisloge commented 4 years ago

Just as a small sidenote:

just tried it with the latest office365 and with the setup over C:\Program Files\Microsoft Office\root\Office16\OLCFG.EXE it setups the active sync without problems

Adorfer commented 4 years ago

Any news on this?

works on office2016 and office365. (setting up new clients regularly. can't see any issue with mailcow.)

P. S. in case you have trouble setting up your dns according to the docs it would be a support question out of scope here.

RickD123 commented 4 years ago

This bug is still a problem and I could not configure an IMAP account in Office 365. It was only after doing a "reg add HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\16.0\Outlook\setup /T REG_DWORD /F /V DisableOffice365SimplifiedAccountCreation /D 1" that I was able to manually create the account.

andryyy commented 4 years ago

Why were you not able to create an IMAP account? That's never an issue.

If you use a stupid Office 365 version, which will only allow you to add an Office 365 account, I don't feel the need to change anything in mailcow. You should switch to a proper IMAP client then. :)

Pihaar commented 4 years ago

There is a website from microsft which emutaltes the access of outlook to various Mail Server Services: https://testconnectivity.microsoft.com/tests/exchange

E.g. for ActiveSync I got this result: image

Here the error message in plain text:

Testing HTTP Authentication Methods for URL https://mail.example.com/Microsoft-Server-ActiveSync.
The HTTP authentication test failed.
A 401 error was received from the server, but no authentication methods are supported. HTTP Response Headers: Connection: keep-alive X-Frame-Options: SAMEORIGIN Content-Length: 0 Content-Type: text/plain; charset=utf-8 Date: Tue, 12 May 2020 07:52:42 GMT Server: nginx WWW-Authenticate: basic realm="SOGo"
Elapsed Time: 483 ms.

The shown SSL warnings are not relevant in my oppinion.

You can try this out, but I'd recommend not to use your productive mailbox as you need to provide your credentials.

rsecor commented 4 years ago

@Pihaar Unfortunately that tool does not mimic reality when it comes to Microsoft Outlook 365 - Desktop Version.

J-Rey commented 2 years ago

Microsoft 365 (O365) deprecated EAS in favor of REST a few years ago but that's irrelevant since clients should expect to connect to Mailcow the same as Exchange Server which still enables EAS by default.

The issue is that Mailcow is using the oldest method of detecting via Autodiscover that was for Exchange 2007, POX.

If we at least use SOAP for Autodiscover service (introduced with Exchange 2010) then maybe we won't have to use the workaround & could support Outlook for macOS by the time they support on-premises Exchange later this year.

To be thorough, we could also consider supporting the primary API for Exchange, EWS. It does have Autodiscover but its schema changes for each version of Exchange Server & they promote a managed API so it seems not to be worth the extra effort especially considering how slow this issue has been progressing.

mkuron commented 2 years ago

Finally, Microsoft provides some documentation on this... Unfortunately, judging by https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/setting-soap, it seems like the SOAP autodiscovery only works for EWS. As long as SOGo doesn't support EWS, it won't be useful for Mailcow.