handling of text and multipart messages