Is there any particular reason why you have deleted the new version of guess_mimetype() (which calls guess_encoding() ) and replaced it with the older version?  The key reason for re-using guess_encoding() was to have consistent mime type detection across both calls.

Is it possible you didn't use the newest version of alot when you wrote this patch?

The commit that introduced the new version is https://github.com/ignatz/alot/commit/7a9da3b0fcc0edca4fcfd8bf0818992dea88a5fc