Functions to parse MIME multipart messages