Salaam / Courtesy Over Distance

Match the other person rather than imposing your own habits

The general principle underneath everything here is to take your cue from whoever you are addressing.

If there is one idea worth carrying out of all of this, it is that matching beats imposing. Whatever the setting, the person you are greeting has a way of doing it that feels normal to them, and moving towards that way is nearly always better received than requiring them to accommodate yours. This holds for the length of an opening, for the use of titles and names, for how much warmth is offered before it is earned, and for the physical part, where following somebody's lead is the only defensible approach in any case.

Matching is not imitation and it is certainly not performance. Copying the surface features of how somebody greets, particularly when it is unfamiliar to you, tends to read as mimicry and lands badly. The version that works is quieter: adjusting your register a notch towards theirs, using the form of address they used, replying at roughly the length they wrote at, and not insisting on a level of closeness they have not proposed. It is a shift of a few degrees, not a change of costume, and it is usually felt rather than noticed.

The reason this principle holds up better than any list of rules is that it needs no advance knowledge. You cannot learn every convention, and trying to means carrying a mental card index of assumptions about people that will be wrong more often than it is right. What you can do is arrive with your own habits held loosely, pay attention for the first few seconds, and move towards whoever is in front of you. That is not a technique. It is just what noticing somebody looks like when it is done properly.