Command Line Tool to Batch Convert .EML/.EMLX/.MBOX to Searchable PDFs?
I had to do this with ~180 emails, and I used a command tool I found on GitHub that converts .eml to .pdf via .html: https://github.com/nickrussler/eml-to-pdf-converter

It takes a little while to convert each .eml file - 22 minutes for 186 emails with lots of images - so it's probably not helpful for a 500k email task. (Maybe if you're reeeally not in a rush and not afraid of multiprocessing!) If it is helpful for you or anyone else, though, here's how I got it to work in the bash command line:


git clone the repo
Install the wkhtmltopdf tool from binary (installing with pip is insufficient) from here: https://wkhtmltopdf.org/downloads.html
From within the cloned repo, generate the email converter .jar file: ./gradlew shadowJar
Run for loop to convert every file in the .mbox (or a directory of .eml): 


for file in /path/to/mailbox.mbox/*; 
do
   java -jar ./build/libs/emailconverter-2.0.1-all.jar "$file"; 
done