I do this with https://www.sphinx-doc.org/ + a basic Makefile and config file to make it a bit nicer. I will publish my template a bit later and report back.
I wrote this ansible role to setup dovecot IMAP server. Once a year I move all mail from the previous year from various mailboxes to my dovecot server (using thunderbird).
https://goaccess.io/