Backport `Mail preview tab: fixed bug in mimetype lookup...` to 3.4-stable

Backport of #521 to `3.4-stable` branch.