Fix HTML part detection for some specific message structures (#1488992)