UWaterloo Email - DavMail

DavMail is a tool that can be used to bridge Microsoft email accounts (such as UWaterloo.ca email) to IMAP, enabling the user to use third-party email clients.


Install DavMail

On Arch: DavMail is available through the AUR.

On Debian: sudo apt install davmail

From Flathub: flatpak install flathub org.davmail.DavMail

On Linux: See http://davmail.sourceforge.net/linuxsetup.html

On macOS: See http://davmail.sourceforge.net/macosxsetup.html

On Windows: See http://davmail.sourceforge.net/windowssetup.html

Set up your email client with DavMail

You should be able to use any email client that supports IMAP. This guide assumes that you're running your email client on the same device as DavMail. (Note: This guide uses Thunderbird as an example, but DavMail is not necessary for using Thunderbird with UWaterloo emails. See UWaterlooEmailThunderbird for using Thunderbird directly.)

When you first run DavMail, it will launch a menu allowing you to configure the gateway.

davmail settings

Change the Exchange Protocol to O365Interactive. This will enable you to authenticate with 2FA. Save this change.

the same menu, but the exchange protocol has been set to O365Interactive

Now, open your email client and set up your email account. Fill in your information, using your @uwaterloo.ca email address.

Thunderbird Account Setup menu with the information filled in. The mouse is about to click "Configure manually"

You will need to manually configure the server details with something like the following:

Incoming server:

  • Protocol: IMAP
  • Hostname: localhost
  • Port: 1143
  • Connection security: None
  • Authentication method: Normal password

Outgoing server:

  • Hostname: localhost
  • Port: 1025
  • Connection security: None
  • Authentication method: Normal password

the settings as described above

Attempt to log in. Your email client may complain that you're making an unencrypted connection. This is fine because you're just connecting on localhost (i.e., not sending data over a network). If you're running DavMail on a server, make sure to change this setup accordingly.

The "I understand the risks" checkbox has been checked, and the mouse is about to click the Confirm button.

DavMail will now open a dialog asking the user to authenticate with Office. Click the link to open it in your browser.

a dialog which asks the user to open the link, authenticate, and paste the resulting authentication code URL back into the dialog

This will open a UWaterloo login page. Sign in as usual.

UWaterloo sign-in page

Complete the Duo 2FA.

Duo 2FA with the authentication code entered

If this is your first time connecting DavMail to your account, Microsoft will ask if you want to grant permission for it to act as a third-party app. Accept this request.

Microsoft "Permissions requested" dialog for DavMail

You will be redirected to a blank page. Copy the URL from your URL bar. It contains the OAuth2 code needed for DavMail to authenticate.

blank page with an OAuth2 URL

Paste this URL into the DavMail window and click OK.

the same davmail dialog as before, but now the authentication code URL has been pasted in

Go back to your email client and try again to log in. This time, you should log in successfully!

the Thunderbird Account Setup page again

Account successfully created


Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2022-09-17 - V3CNA
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback