I second this. mbsync+notmuch (JGI; hundreds of blog posts) is a great simple solution for storing and querying emails. Only caveat is that notmuch will basically duplicate the email contents in its database, so you’ll end up taking twice the space on disk.