Forum Discussion

fansari's avatar
fansari
Copper Contributor
Mar 22, 2025

Evolution with business account (oauth2)

Recently domainFactory migrated mail to Microsoft 365 business accounts.

I used to use the Evolution mail client (Fedora Linux, flatpak version) for mail.

Unfortunately I am not able to login to my account with Evolution. You can find my discussion here:

https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/515#note_2384010

I also noticed that the login is no problem with a personal account.

Does anybody have experience with this?

5 Replies

  • fansari's avatar
    fansari
    Copper Contributor

    I have now also tried to build a react app.

    https://learn.microsoft.com/en-us/entra/identity-platform/sample-v2-code?tabs=apptype

    But also this behaves same. I get the popup to login but when I do so the result is an empty white page.

  • fansari's avatar
    fansari
    Copper Contributor

    Please see above what I have tested so far.

    When I enter this URL (I put in my tenant and application ID) I am asked to login with my organisation and when I do so I only get a blank white page without any error or confirmation.

    https://login.microsoftonline.com/<TENANT ID HERE>/oauth2/authorize?resource=https%3A%2F%2Foutlook.office.com&response_type=code&response_mode=query&prompt=admin_consent&client_id=<APPLICATION ID HERE>&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient

  • fansari's avatar
    fansari
    Copper Contributor

    I have tried all this without success.

    Also I have followed this guide and created my own application.

    https://wiki.gnome.org/Apps/Evolution/EWS/OAuth2#Troubleshooting

    Evolution shows this error message: 

    The reported error was “Could not connect to autodiscover.frank-ansari.de: Connection refused”.

    But the CNAME for autodiscover is set available.

    ;; ANSWER SECTION:
    autodiscover.frank-ansari.de. 3030 IN    CNAME    autodiscover.outlook.com.
    autodiscover.outlook.com. 19    IN    CNAME    atod-g2.tm-4.office.com.
    atod-g2.tm-4.office.com. 60    IN    CNAME    autod.ms-acdc-autod.office.com.
    autod.ms-acdc-autod.office.com.    10 IN    A    52.98.240.56
    autod.ms-acdc-autod.office.com.    10 IN    A    52.98.240.120
    autod.ms-acdc-autod.office.com.    10 IN    A    52.98.239.120

    From this page

    https://learn.microsoft.com/en-us/exchange/troubleshoot/outlook-issues/cannot-set-up-profile-autodiscover

    I checked this but this also fails.

    https://testconnectivity.microsoft.com/tests/O365Ola/input

     

     

    After login I get this window:

     

     

    Then there is nothing.

    In Azure I see this URL for my application.

    https://outlook.office.com/EWS.AccessAsUser.All

    I put application and tenent ID in here.

    This gives this error:

    I am still stuck with this.

  • Please consider this:

     

    1. Check Evolution Version: Ensure you're using the latest version of Evolution and the evolution-ews plugin. Compatibility issues often arise with outdated versions.
    2. OAuth2 Configuration:
      • In Evolution, go to Edit > Preferences > Mail Accounts.
      • Select your account and ensure the authentication method is set to OAuth2.
      • Verify that the server settings match Microsoft's requirements:
        • Server Type: Exchange Web Services
        • Host URL: https://outlook.office365.com/EWS/Exchange.asmx
    3. Azure AD Permissions: Sometimes, business accounts require specific permissions in Azure Active Directory. Ensure that your account has the necessary API permissions for email access.
    • fansari's avatar
      fansari
      Copper Contributor

      See above what I have tested so far.

      Also when I check this URL (I fill in my tenant and application id here) I am asked to login (I can choose my organisation) but when I do this a blank white page appears without any confirmation or error message.

      https://login.microsoftonline.com/<TENANT ID HERE>/oauth2/authorize?resource=https%3A%2F%2Foutlook.office.com&response_type=code&response_mode=query&prompt=admin_consent&client_id=<APPLICATION ID HERE>&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient

Resources