parse basic and message header.