By default, anyone can send a message to you and invite you to projects. You can change this setting by going to Edit profile (1), Privacy (2). The following settings are available:
- Anyone - anyone can send a message to you.
- Only people I follow - only people you have followed are allowed to contact you.
- Only for some friends... - only the people you specify on a whitelist are allowed to contact you.
- Turn off - Noone can contact you at all. But wouldn't that be lonely?
This works both ways, so you can only send messages if both you and the recipient allow communication between each other.
This does NOT apply to walled gardens.