The following is a tutorial shows how to setup USherbrooke emails with the amazing terminal-based neomutt. To simplify the process, I will use mutt-wizard to streamline the installation. My current OS is Artix Linux and therefore, any command used in this tutorial will be for that operating system (although most will work on any unix-based system):
Step 1 Install neomutt, mutt-wizard and davmail: yay -S mutt-wizard-git davmail neomutt
Step 2 Run davmail once and immediatly kill it (killall java
) to create
its default config file
Step 3 Edit the values in the ~/.davmail.properties
file to match the
following:
davmail.server=true
davmail.mode=O365Manual
davmail.oauth.tenantId=3a5a8744-5935-45f9-9423-b32c3a5de082
davmail.oauth.clientId=7068f0e2-17d9-4413-8bed-0959dd92e5a8
davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
davmail.oauth.redirectUri=https://login.microsoftonline.com/common/oauth2/nativeclient
Step 4 Create your email account for neomutt using mutt-wizard. It's
important to note that some areas need your email with the
[email protected] format. Other places require that you use
the [email protected] format. Davmail is setup pretty similarly to Protonmail.
We can therefore use the -pf
flag when configuring the email. Don't forget to
respect capitalization The command should look like this:
mw -pf -a [email protected] -u [email protected] -x "YourUSherbrookePassword"
At this point nothing should happen. This is normal.
Step 5 Run davmail
. Make sure to run it
interactively (do not run it with setsid
) as you will need to paste a url.
Step 6 In a separate terminal window, run mbsync [email protected]
.
Step 7 A link should have appeared in the davmail terminal window. Copy it and paste it in a browser. Upon entering it, you should see the link change in the browser bar (it's normal that the page remains blank).
Step 8 Copy the changed url and paste it back in the terminal running davmail.
Step 9 You should now be able to repeat step 6. But this time, your emails should actually sync properly. Your setup is practically done!
Step 10 Currently you have davmail running in a separate terminal window. Quitting it will prevent your mail from syncing. Consider running it as a standalone process (such as a runit user service or a systemd service at login). This way, you won't have to worry about davmail anymore.