We're supposed to return the salam; see Islam Q&A and
And when you are greeted with a greeting, greet [in return] with one better than it or [at least] return it [in a like manner]. Indeed, Allah is ever, over all things, an Accountant.
Sometimes non-mahram men say salam to me (e.g., through instant messaging). If I respond to the salam, then I enter into a conversation, and sometimes they talk about incrementally less appropriate topics, to the point where (after a while) I'm unsure if I've done something haram.
I'm wondering if it's best, in these circumstances, to simply not return the salam (particularly when the non-mahram man has previously engaged in inappropriate conversation).
Question: Does Qur'an 4:86 ("greet in return") apply to women when greeted by a non-mahram man?