Kmail/Configuring Kmail/Accounts/Office 365

From KDE UserBase Wiki

Office 365 is Microsoft's online office suite which includes an Email service. Traditionally one would access it with Microsoft Outlook locally or on in the web browser.

KMail has two methods of accessing Office 365.


Be aware, sometimes this doesn't work at all and you keep getting an authentication error.

In your Outlook settings search for IMAP or POP to find the servers and settings you need to use.

Most likely they will look like

Server name
Port 995 993 587
Encryption method TLS TLS STARTTLS

For your username enter your full email address and then enter your password.


This will give you access to all your calendars and contacts as well. Unfortunately there's a bug that makes it a little cumbersome to setup, but it works nonetheless.


  1. Enter your full email
  2. Fill out the authentication with any information you like (workaround for the above mentioned bug)
  3. Now change to Oauth2(Office 365)
  4. Set the EWS URL to

You should be greeted with a popup asking you to enter your credentials. Once all is done you can then select what to sync e.g Agenda, Email (which folders), Contacts, etc.

Outgoing server

To configure the outgoing server:

  1. Go to Settings > Configure KMail... > Accounts > Sending
  2. Click "Add..."
  3. Give the account the name that you want.
  4. Make sure that the type is "Microsoft Exchange Server (EWS) transport agent".
  5. Click on "Create and Configure"
  6. Modify any detail from the next window, and click "Ok"

You should now be able to send messages from the selected account.