Using Davmail to Connect IMAP Clients to Office365

About Davmail

If you need to use Thunderbird, Pine, or another IMAP-based mail client at UVa, you'll need to install and configure davmail as described below.

Davmail is a proxy server that runs on your computer and allows IMAP and SMTP clients like Thunderbird to connect to Office365, even if the connection requires Multi-Factor Authentication (MFA) such as Duo.

After installing and configuring davmail as described in the following sections, see instructions at this link to configure your e-mail client:
http://galileo.phys.virginia.edu/compfac/faq/imap-office365-mfa.html

  • Installation:
  • Configuring Davmail:
    Start davmail. The first time you run it, it will pop up its settings window. Configure it as shown in the following screenshots.

    In the "Main" tab, set the Exchange Protocol to "O365Interactive":

    In the "Encryption" tab, enter the ClientID. The ID can be found at the link below, after logging in through NetBadge:

    https://web.phys.virginia.edu/Private/office365-mfa-ids.html

    Note that you should use the client (AKA application) ID, not the tenant ID.

    If you have folders with many messages, you might want to set the "Folder Size Limit" in the "Advanced" tab initially. Setting this to 1024, for example, will cause davmail to only fetch the latest 1024 messages from each folder:

    After changing these settings, click the "Save" button at the bottom of the window. This will save your settings into a file named .davmail.properties in your home directory (Linux, OS X) or davmail.properties at the top level of your profile (Windows).

    Davmail should now appear as a small yellow circle on your task bar. You can change its settings later by right-clicking on the circle and selecting "Settings".

    After its icon appears, davmail is ready to accept connections from mail clients like Thunderbird or Pine.