Using Thunderbird, Pine, and Mutt with Office365 and Multi-Factor Authentication (Duo)

You Must First Install Davmail

Please follow the instructions here:
http://galileo.phys.virginia.edu/compfac/faq/davmail.html
After installing and configuring davmail, follow the instructions below to configure your e-mail client.

  • Thunderbird:

    Before you begin, make sure davmail is running. It should appear as a small yellow circle on your task bar. See instructions above for installing and configuring davmail.

    Next, you'll need to tell thunderbird to add a new account, then click "manual config". Remember to use mst3k@virginia.edu as your mail address when creating the account. The necessary settings are shown in the screenshot below:

    Notice that we're connecting to ports 1143 and 1025 on localhost. This is where davmail is listening. It will accept Thunderbird's requests and pass them along to Office365.

    Since Thunderbird is not actually talking over the network no encryption is required, but this might cause Thunderbird to show you the following warning:

    It's safe to check the "I understand the risks" box and click "Create Account".

    When you log into the mail system, davmail will pop up a window to allow you to do Duo 2-factor authentication:

    Note that the password dialog might show you two password entry lines. This seems to be a bug. I've found that entering the password on the first line works.

  • Pine and Alpine:

    Before you begin, make sure davmail is running. It should appear as a small yellow circle on your task bar. See instructions above for installing and configuring davmail.

    Here are the settings you need in your .pinerc file:

    user-domain=virginia.edu
    smtp-server=localhost:1025/user=mst3k@virginia.edu
    inbox-path={localhost:1143/notls/user=mst3k@virginia.edu}Inbox
    folder-collections=Office365 {localhost:1143/notls/user=mst3k@virginia.edu}[],
    default-fcc={localhost:1143/notls/user=mst3k@virginia.edu}sentmail
    disable-these-authenticators=GSSAPI,PLAIN
    
    Note the particular importance of the disable-these-authentications line. Without this, you won't be able to send mail.

    When pine authenticates you, davmail will pop up 2-factor dialog boxes like the ones shown above in the Thunderbird configuration section.

  • Mutt:

    Before you begin, make sure davmail is running. It should appear as a small yellow circle on your task bar. See instructions above for installing and configuring davmail.

    Here are the settings for your .muttrc file:

    set from="mst3k@virginia.edu"
    set smtp_url="smtp://mst3k%40virginia.edu@localhost:1025/"
    set folder="imap://mst3k%40virginia.edu@localhost:1143/"
    set spoolfile="+Inbox"
    set postponed="+Drafts"
    set record="+Sent"
    set ssl_starttls=no
    

    When mutt authenticates you, davmail will pop up 2-factor dialog boxes like the ones shown above in the Thunderbird configuration section.