define msgforward, isAllowedMsg and stringlen
msgforward