Users may not always be comfortable with getting messages from entire community and may decide that only their connections can send them new messages.
Users can adjust this setting by going to their profile, then clicking on “About” button and switching to “Preferences” tab.
At the very bottom of the page, there will be multiple options regarding messaging behavior. Checking the “Allow new messages only from friends ” will take effect immediately and only friends will be able to send messages to that user.