multipart/mixed parsing logic taken from javax.mail API.