In the 1950s in The Netherlands, it was common for people to hang a little rope through the mailbox, so that children (which apparently did not have a copy of the key) could let themselves in at any time.
On the outside, it looked like this:
outside of door with rope through mailbox http://www.bottercourant.nl/images/nieuws/2016/12_December/SFA007002142.jpg
Source: Botter Courant
And on the inside:
Source: user bjorntm, thingyverse
Clearly, this is actually a work-around for people who have a self-locking door but rather wouldn't. I've visited areas where people don't normally lock their doors, and even where the cultural expectation for a visitor (stranger or not) is to simply enter and shout Hello!. Not locking the door in the first place would seem a rather more convenient solution.
In the history of locks and door locks in particular, when were self-locking doors invented and when did they become commonplace?