Then you'd probably need a message-id to filename index, and still have
the same problems :-) Admittedly, it'd probably be easier to generate
this index than a more complex one.
Yup. And that was as far as my thinking got. The annoyance level of the
problem hasn't floated up above the threshold required for me to spend
time working on it.
How 'bout hard-linking each message into a directory (outside your
MH directory) named after the Message-ID? Then you'd be guaranteed
unique names that wouldn't ever change, you wouldn't use noticeably
more space, and you could find any message quickly by Message-ID.
(And you could run your indexing on only the new files in that directory.)
If you wanted to prune it, you could remove all files that had exactly
one hard link - that would be files that had already been removed
from all your MH folders.