Following a previous question: what about situations beyond the street such as the cashier or clerk in the market? If the clerk is female and as a good employee says hello and asks if she can help me should I say hello but avoid too much direct eye contact? Also, I tend to smile at people when I say hello. Should I be more careful in this circumstance?
The reason for the prohibition to great a woman is, since it might lead to unhealthy closeness between the two. Therefore if a person knows for a fact that his heart is pure and it is only a courtesy of politeness and never lead towards any closeness – it will not be a Halachic problem. (Mishne Halachot 4, 46; based on Rema EH 21, 5 and Yam Shel Shlomo Kidushin 4, 24) Blessing a woman with "good morning" etc. is permitted in any case. (Sridei Esh 2, 112) In addition to the above - being nice is extremely important, same for smiling. (Ketubot 111b)