When a stranger approaches me with a generic salutation without a specific request -- e.g., "Hi!", how should I politely inquire about their purpose or matter/ topic of addressing me ?
Directly it would be "what do you want from me?", but how to say the same politely? In my native language it is something like "How can I serve you?", but this sounds to me excessively submissive -- in fact I am not their servant; maybe "In what way can I help you?" ?; but this sounds to me too specific, as offering some service, i.e., as asking for being assigned a specific task, so that a natural expected answer to such a question understood too literally could be "two mugs of beer, please" (once in such a situation I got an answer "send me money" -- I guess it was a joke ridiculing the literal meaning of my question ) ; instead, I want to make it clear that my reply is just a generic polite formula with no literal meaning, i.e., I want to be nice to them, but not to offer my service really.
For example, if somebody messages me with a "Hi :)", an answer that I might expect to such a polite question that I am looking for, could be "professor, I am interested in studying PhD in your Lab under your guidance" or "I want to publish a paper in your journal", if this is the case i.e., if this was the motivation (subject / topic) of their contacting me. -- not "send me money" or "two cups of coffee, please".