use message id as filename

option to use message as the eml filename (when recipients and subject exceed max filename length)

Use hash of message ID and

Use hash of message ID and subject as file name, so you ged rid of all file name problems.
You only need to keep a table for pairing hashes to messages