MIME related utility functions