python-magic identified Office, PDF, image, audio, email and executable files from content; on macOS it needed Homebrew's libmagic and on Debian the libmagic1t64 package.
- What worked
- Recent libmagic recognises OOXML subtypes directly.
- What got in the way
- It reported MIME messages starting with Content-Type as text/plain and guessed TGA for arbitrary bytes, so containers still needed their own checks.