Russians usually do not to smile to strangers and do not smile to people who they don't socialize with.
Smile is addressed mainly to people whom you know. That is why the shop assistants, waiters and others of this kind don't smile to the customers - they do not know them. Russians will smile to familiar customers. Although lately it's getting better.
I remember that time when you could be stopped by any old man or woman and he or she would shout at you: "Why are you grinning? Do you feel so good?"
And if you will smile while your teacher or other supervisor is scolding you, you will have big problems. It's better to hide the smile, in this case you will be punished less.
Even now you can come across with old women, who usually work as concierges, who never smile. If she shouts at you, and you are smiling, they become very furious.
I remember that once I was stopped by the traffic police for speeding and they sent me to pay a fine to another building. I was in a such good mood for some reasons that I went in smilling to a man who takes fines. And suddenly he said: "You don't need to pay!". I was surprised and he added, "You are the first person who smiled to me while I am working here." He was incredibly nice to me.
Although it could be vice versa. Several years ago (and sometimes now too), if a girl smiled to a policeman he could say "why are you grining? May be this fine is too small for you?". I was lucky that time.
Smile is not a signal of politeness in the Russian communication. Constant polite smile is called ‘a duty smile’ in Russia and it is considered to be a demonstration of his insincerity, stealth, and unwillingness to open true feelings.
A russian smile is intended to be only sincere, and usually it is a signal of personal favour to someone or demonstration of good mood. This smile shows a personal sympathy to whom it's addressed. If you smile to a russian stranger, he can ask you: “Do we know each other?”
The smile of russian people should have grounds known to other people, only in this case a person can have a "right" to smile.
There is one unique proverb in the Russian language: “Laughter without cause is the sign of foolishness”. People with a Western way of thinking can't understand the logic of this saying.
I think Russians are not against to smile to everyone, if only they are sure that this is not judged and everybody understand them correctly, and they don't look like fools. Therefore when Russians move to other, "more smiling", countries they get used to smile little by little :) Especially if they are young people who have only childhood memories about a conviction of smiling.