How is "Show alerts from my contacts" for Messages in iOS Notification Center supposed to work? I've started using 2-factor authentication with a bunch of services. So, after I sign in, I get an authorisation code SMS'd to me. Now, if my phone is locked, I really don't want code appearing on the lock screen, but I generally like showing the SMS preview.

I noticed in Notification Center -> Messages, there is a choice:

Show Alerts from Everyone
Show Alerts from My Contacts

Now, I assumed that if I chose, "Show Alerts from My Contacts", but kept "Preview" on, if the SMS sender wasn't in my address book, I wouldn't see the Alert, and certainly not the Preview on my lock screen. However, I can't find any discernible difference between these two settings.

Every SMS I get from numbers NOT in my address book, I see the banner if the phone is unlocked, and I see the Preview if it is locked, and I see the Preview on the Lock Screen in the Notifications pulldown.

What gives? Am I misunderstanding the functionality of this setting?

It's an iPhone 5S, running 7.1 (11D167)
There's 2 different things here which are not pretty clear.

First of all, there's SMS and iMessage.

And like explained on this blog you can restrict iMessages from giving a notification if you decide you want contacts only (since iOS6). This does not work for SMS.

With iOS the name of Show iMessage alerts from changed, but the functionality remained the same.