Bug 467734

Summary: Automatic detection of email providers using Office 365
Product: [Applications] kmail2 Reporter: Louis Moureaux <m_louis30>
Component: config dialogAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: wishlist    
Priority: NOR    
Version: 5.22.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description Louis Moureaux 2023-03-23 23:37:24 UTC
Microsoft provides many organization emails around the world through its Office 365 product so it would be good to have first-class support in KMail. KMail already features EWS support, but setting it up for O365 is far from intuitive [1].

Fortunately, detecting O365 emails is easy. If the address is user@example.com:
1. Perform a MX DNS lookup for example.com
2. Look at the first exchange record. The provider uses Office 365 if the exchange is of
   the form:

     example-com.mail.protection.outlook.com

   One can then reasonably assume that Office 365 EWS is supported.

Adding this simple check to the account setup wizard could enhance its results for a large number of (corporate) domains. Saving the users from the hassle of setting up EWS all resources (incoming, outgoing, contacts, calendar) by hand would be a significant improvement.

[1] https://userbase.kde.org/Kmail/Configuring_Kmail/Accounts/Office_365

ADDITIONAL INFORMATION

Office 365 setup instructions with MX record details: https://learn.microsoft.com/en-us/microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider?view=o365-worldwide#add-an-mx-record-for-email-outlook-exchange-online

Some example domains using O365 (as of 2023): ulb.be, student.uclouvain.be, cern.ch

In my testing, QDnsLookup did the MX lookups perfectly well.