Mail with Outlook/Office365 servera

I am experiencing some problems setting up an MS outlook/office365 account. Prior to 26 Oct 22 the setup worked fine on Mail but everything crashed yesterday. As I understand it MS no longer support the password option but use Oauth2 login. Problem arose when authentication failed in Mail. I deleted the account and recreated it. Despite numerous approaches (including setting up email address on K9 Mail and FairEmail apps and installing MS Edge) I could not get the Oauth2 to work for Mail. I did get it to work correctly for K9 Mail and Fair Email by switching off Advanced Privacy.
With the /e/ Mail app the problem occurs when the authorisation step moves to the login web page of outlook login, the correct email address appears, once the password is enter the login pages either never finds the server or just freezes stating that you are trying to login into K9 app. However, on this step with the K9 mail app the authorisation finds the server and goes straight through to the email page and works correctly at this stage.
I can work around this by using another email app but it is a bit cumbersome.
Thanks for any suggestions?

btw, it would matter on what /e/ Version you run. The Mail app is a k9mail fork. The fork got updated in v1.2 to k9mail 6.2+ - so Oauth2 should work after v1.2. If it doesn’t it shouldn’t be due to Mail then.

The Advanced Privacy hide-my-ip (Tor) feature is controversial so I leave it off most of the time. But according to user thilo in the gitlab issue it is surprisingly not due to Tor, but a tracker-block that targets that hinders the Oauth2 flow to work:

… it seems like the tracker displayed as “Mobile Engagement” is blocking

If you want to keep tracking-blocker enabled, allow this (wrongly identified) tracker

… this is at least a (bad) case where functionality and tracking are closely coupled

that one tracker rule had quite some impact:

Thanks Tcecyk,
I am running /e/V1.4 so I think I should have the latest Mail.
With Fair Email app (works) Mobile engagement tracker was active - I have switched that off - but it seemed to work whilst tracking. WRT to Mail I only have google analytics and generic ‘Block trackers’ option. I switched those both off for Mail and added my Outlook/Office365 account - still does not work - gets to a webpage with my email address and states: Are you trying to sign in to K-9 Mail with the option to cancel or continue. Pressing continue does nothing.
However, I found that I was using DuckDuckGo browser and not the /e/Browser, DDG would not load my outlook a/c but /e/Browser did!
So I have gone and removed DDG so default is /e/Browser and I get further - MS outlook login page but it never completes the operation. When I try again I get back to the K-9 question above. Even with Switching phone off, clearing all data from I still end up on the K-9 page above :grimacing:
I will try again with a restart…

1 Like

Just a small addition to the above. I have made DuckDuckGo default and able to load online the outlook account by ensuring tracker Mobile Engagement is enabled. That’s a big step!
I went back and tried DDG with a clean install to set up my outlook a/c using DDG and it still goes to the “Are you trying to sign in to K-9 Mail with the option to cancel or continue. Pressing continue does nothing.” option.

1 Like

now lets play 4d-chess and use Firefox as webview with ublock disabled? it reads like you’re fighting tracker blocking in different layers … some browser that doesn’t block the Authentification request to microsoft to get past Oauth2

having adb logcat running while pressing the button (that does nothing) would help to have a tangible error message to go search for causes - there’s also chrome/firefox remote debugging to check which request it is blocking

I have tried unblocked MS Edge - that’s 3 browsers, at least 2 with Privacy off, also browsers with mobile engagement switched off. None of it works. I agree it’s a blocking issue but I am afraid I have given up the will to live on this one and will switch over to another Mail app.
Thanks for your suggestions and time - however, Mail should not be that difficult to operate :thinking:

Make sure the outlook app uptodate.
That was my solution

Thanks for the suggestion, however, I am using /e/ Mail and not Outlook app. Both Mail and /e/ operating system are up to date.
Have tried with Firefox - gets to a slightly different place but still ends up with same issue of trying to confirm the use of K-9 app but does not progress. That is the fourth browser I have tried :face_with_diagonal_mouth:

1 Like

I unearthed an MS account and tried to get some debug. The issue seems to be the return of the browser auth to k9 with a intent that contains the auth (“dat=msauth://com.fsck.k9/…”)

E App     : failed to start third party app activity
E App     : android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=msauth://com.fsck.k9/Dx8yUsuhyU3dYYba1aA16Wxu5eM=?code=hunter2 flg=0x10000000 (has extras) }
E App     : 	at

k9 is registering for that intent at

so my wild guess - not familiar with Android appdev much, the Manifest uses the appid as variable at

<data android:scheme="msauth" android:host="${applicationId}"/>

and I wonder if this collides with the appid customization to foundation.e.mail at app/k9mail/build.gradle · a59f9b37 · e / os / Mail · GitLab

as the scheme the mail intent is listening for dat://foundation.e.mail/… but mail emits the k9 appid host.

So I guess the constant OAUTH_MICROSOFT_REDIRECT_URI at app/k9mail/build.gradle · a59f9b37 · e / os / Mail · GitLab needs to be adjusted

Edit: filed at Mail and microsoft Oauth2: No Activity found to handle Intent (#6198) · Issues · e / Backlog · GitLab

1 Like

Any news yet? I am havng the same issue related to MS Outlook accounts and OAuth2 with latest build /e/ OS 1.15…

Morning, I don’t know - I gave up trying to use the e Mail app and used a different app - FairEmail - it works fine. Sorry I cannot help.

1 Like