offlineimap with outlook365

Recently the University of Bristol made the switch from the Google to Microsoft platform for email, calendar etc.
As a user of mutt the impact was somewhat minimal for me but I did have to figure out the new settings to get offlineimap to sync my mail and mutt to send it.

Here is what worked for me.

[Account bristol]
localrepository = bristol-Local
remoterepository = bristol-Remote
status_backend = sqlite
maxsyncaccounts = 6

[Repository bristol-Local]
type = Maildir
localfolders = ~/Mail/bristol

[Repository bristol-Remote]
type = IMAP
remoteuser = userid@bristol.ac.uk
remotepass = password
remotehost = outlook.office365.com
remoteport = 993
realdelete = no
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
folderfilter = lambda folder: folder in ['INBOX', 'Sent', 'Drafts', 'Sent Items', 'Junk E-Mail']

I use mutt directly for SMTP and the settings that work for me are
set smtp_url = "smtp://userid@bristol.ac.uk@smtp.office365.com:587"


Hopefully this helps someone else who knows mutt is the one true way of working with email :)
This was posted on Sun 23 Jul 2017 by Ryan McConville