lib: Add an API to find a message by filename.