Revised code to determine mime type from *decoded* attachment body