HowTo: mail with mutt, davmail, exchange, and XOAUTH2

Peter King and Dave Collier-Brown expressed interested in using mutt (or other IMAP client) with exchange, and I thought this might be of general interest. So a new thread. I've been using mutt and davmail to do Office365 (exchange style) mail for almost two years, and it has been working great for me. I archive my mail into mbox files on my local machine, but there should be nothing preventing saving to IMAP folders (other than more typing). I mentioned this in a list message in April last year I use this to access work M365 and Seneca College M365, which both require multi factor authentication. On my ubuntu desktop/laptop I install the packages davmail and openjfx, and my ~/.davmail.properties includes (among others) davmail.mode=O365Interactive davmail.url=https://outlook.office365.com/EWS/Exchange.asmx davmail.smtpPort=1025 at startup/login I run ( davmail -server > /dev/null 2>&1 & ) and my .muttrc has things like set imap_user="jsellens@example.com" set spoolfile=imap://localhost:1143/INBOX set smtp_url = "smtp://jsellens@example.com@localhost:1025/" set smtp_authenticators = "login" set ssl_force_tls = no Start up mutt, get prompted for password, get popup window asking for two factor (e.g. google authenticator, or duo push), comply, and there's my mail. And davmail is willing to cache credentials, so I don't always have to two factor. Note that this does not require IMAP access to M365 - it uses the "normal" exchange protocols, just like Outlook would. Feel free to let me know if you run into problems, and I'll try to help. Hope that's helpful! John
participants (1)
-
John Sellens