Evolution EWS Setup Fails

Hi everyone,

I’m trying to set up a EWS account in Evolution on Ubuntu Noble, and I’ve hit a wall that I can’t get past, and AI is sending me round in circles.

My system

• Ubuntu Noble

• Evolution 3.52

• evolution‑ews 3.52.0‑1build1 (confirmed installed)

outlook.com e-mail address.

The problem

When I try to add my Microsoft 365 account, Evolution never shows the proper EWS setup screen. Specifically:

• Autodiscovery does not appear, and there is no Cancel button

• I get the screen where you can choose Exchange Web Services

• I never see the Authentication dropdown

• OAuth2 never appears

• The Microsoft login window never opens

• If I Check for supported types… no supported types available

The result if I manually override Oauth2 is that the account gets added but has no mail, no calendar, no contacts, because it never authenticated. I now know manual overrides are not allowed.

What I’ve already tried

• Confirmed evolution-ews is installed

• Disabled old Microsoft 365 account

• Cleared Evolution caches ~/.cache/evolution and ~/.config/evolution/sources

• Restarted Evolution with evolution –-force-shutdown

• Ensured I’m using Evolution → Edit → Accounts → Add → Mail Account (not GNOME Online Accounts)

• Widened the setup window in case OAuth2 was hidden

• Reinstalled Evolution and evolution‑ews

• Rebooted the system

What I expect to see (but don’t)

• Autodiscovery with a Cancel button

• The Authentication dropdown with OAuth2

• The Microsoft login window

Why is Evolution skipping the EWS setup flow entirely, and how can I force it to show the OAuth2 authentication option so Microsoft 365 can authenticate properly?

Any guidance would be hugely appreciated.

I now know manual overrides are not allowed.

Hi,

the above is not true. Being it so you’d not have it offered at all.
It’s just changing that after you configure the account is problematic
due to the code flaws. It needs fixing.

Why is Evolution skipping the EWS setup flow entirely, and how can I
force it to show the OAuth2 authentication option so Microsoft 365
can authenticate properly?

I only recently realized the authentication prompts right after the
account is configured/added can be tricky to show for some accounts.
Another things related to authentication, which needs fixing. I cannot
tell whether it’s what you face, though.

Let’s start with simple things:

a) what is the Host URL of the “Exchange Web Services” account, please?
It should be https://outlook.office365.com/EWS/Exchange.asmx
I suppose it’s close to that, otherwise you won’t get the OAuth2
authentication method offered.

b) you should see some error messages when the account is accessed,
like when you use Send/Receive button. Is there any such thing?
The status-bar can show that the account is connecting, or
the folder tree can show a spinner beside the account name when
it’s connecting. It happened recently that some servers advertise
IPv6 addresses, but when the client tries to connect there the
server does not respond. I do not recall seeing any such thing
with the Microsoft servers, but who knows. A workaround was to
disable IPv6 in the system.

c) I suppose you see the mail account in the folder tree, but it cannot
be expanded, because it does not know about any of the folders in
that mail account. You can see an icon on the right side of
the account name in the folder, probably something like a broken
connection or similar? It indicates there’s a problem with the
account. When you right-click the account name, you can pick
Refresh action, which will try to connect to the server.

d) run Evolution from a terminal as: EWS_DEBUG=2 evolution
and then see what it shows there. You can use the Refresh
function mentioned above to force it to do something. It shows
only communication between the server and the Evolution, thus
when it won’t communicate it does not show anything. It may
give a clue what failed, or what it is trying to do under the hood.

e) I’m not sure whether you have configured an EWS account on that
machine before or not. Uninstalling the plugin or even the app
does not clean up the keyring with the stored credentials.
You can use Seahorse to check what you have stored in the Passwords
keyring for the Evolution Data Server. The OAuth2 tokens for the EWS
account are named like “Office365[you@outlook.com]”. You can delete
them, then evolution --force-shutdown, then it’ll be like you’d
really configure the account for the first time on the machine.

I guess you are aware you use a very old version, yours 3.52.0 had been
release on 2024-03-15, and it’s even not the latest version in the
3.52.x series (it’s 3.52.4). The current stable series is 3.58.x, which
accumulated many fixes during those almost two years. You’d need to get
the latest version later this year anyway, because Microsoft is
disabling the EWS protocol for the office365.com addresses in October
this year [1]. Do not use the “Microsoft 365” account type in the
3.52.x, please, there had been added some important fixes meanwhile; it
had been too new in the 3.52.x. You can get the latest stable Evolution
either with more recent distribution version, or if you need to use
that old one, then you can get it for example through Flathub.org [2],
as a Flatpak application. It has its downsides in compare to the
packaged version, mostly related to integration with the desktop, but
it’s perfect solution for the old distributions, where getting latest
Evolution is close to impossible otherwise.

Bye,
Milan

[1] https://techcommunity.microsoft.com/blog/exchange/retirement-of-exchange-web-services-in-exchange-online/3924440
[2] https://flathub.org/apps/org.gnome.Evolution

Thank you for your detailed response. I was using the version of Evolution provided by Ubuntu 24.04LTS which probably is the reason it was so old. I have installed the latest version 3.58.2 via flatpak but it didn’t change my EWS issue.

It would seem Microsoft refusing the OAuth2 app registration for my account for EWS. Microsoft 365 option presents the OAuth2 just fine. I mistakenly thought that EWS was the goto option for e-mail and did not know it was being discontinued.

I did have some success with Thunderbird in the past as it could do EWS with a couple of plugins, but they are no longer compatible with Thunderbirds latest build. Last compatible was version 102.15.1. I think they are now on version 147.0.1 probably in response to EWS being depreciated

Can I ask why I shouldn’t use Microsoft 365 option or is it just related to the older version of Evolution? AI informs me that Microsoft 365 is Microsoft Graph the replacement for EWS is this correct?

My reason for wanting to use EWS was It shows e-mails as soon as they arrive whereas Microsoft 365 only does it on a timer. I find it annoying the delay between my phone receiving an e-mail and it appearing on my PC without manually pressing send and receive or waiting up to 2 min that I set (the default was 60min), but that’s just a first world problem lol

Can I ask why I shouldn’t use Microsoft 365 option or is it just
related to the older version of Evolution?

Hi,

it was only due to the old version of Evolution you had. The “Microsoft
365” provider is fine with the 3.58.2.

AI informs me that Microsoft 365 is Microsoft Graph the replacement
for EWS is this correct?

The AI is correct here :wink:

My reason for wanting to use EWS was It shows e-mails as soon as they
arrive whereas Microsoft 365 only does it on a timer.

Yeah, it’s problematic to do, because the Microsoft graph API does not
allow the kind of checking for changes the EWS uses (will soon used to)
offer. They are oriented on servers, to which they can send change
notifications, but it would work only on machines with real IP
addresses, reachable by the Exchange servers from the outside, which
rules out most of the use cases (machines). There are some other ways
to configure an event hub on the server, but I did not make it work
with the developer account, and I cannot expect the users to configure
it on their own, thus the fancy change notifications are kinda stuck on
this, which is sad.

1 Like