Unrelated ask: Does anyone know of a good way to filter my Outlook 365/IMAP inbox using rules running on my Linux box? I want more complex and easily maintainable rules than what I can get via Outlook.

Yup - https://github.com/lefcha/imapfilter

"IMAPFilter is a mail filtering utility. It connects to remote mail servers using the Internet Message Access Protocol (IMAP), sends searching queries to the server and processes mailboxes based on the results. It can be used to delete, copy, move, flag, etc. messages residing in mailboxes at the same or different mail servers. The 4rev1 and 4 versions of the IMAP protocol are supported."