Do you want to automatically block DMs from strangers on Mastodon?
1. Log onto your server's website
2. Go to ⚙️ Preferences
3. Click Notifications (on the mobile website click ☰ and then Notifications)
4. Tick "Block direct messages from people you don't follow"
5. Click "Save changes"
If you change your mind, do the same thing again but untick the box and save changes.