See https://wiki.archivematica.org/Email_preservation
My own practice is to collect individual messages in a single mbox file, I do this twice a year so that the file is not too big. There are many routines that will convert the maildir or EML format to mbox. The resulting file can simply be searched with a command line tool such as grep, or you can load it into a mail client. Since the mbox format is plain text with headers to separate one message from the other, it will remain readable as you migrate from one platform to the next. (I have readable mail files going back 25 years.)