Once the time of Shacharit (Morning Prayer) arrives (after dawn), it is forbidden to go to a friend’s house to say “Shalom”. The same rule applies as well if one were to go from his fixed seat in the Synagogue with the specific intention to walk over to his friend’s seat (Mishneh Berurah). The reason for this prohibition is that since one of
In a case where one happens to be passing by his friend's house, or he sees his friend in the street, or even at the Synagogue (as long as he did not go out of his way specifically to go to him and say “Shalom”), it is permitted to say “Shalom” according to the letter of the law. However, even in these cases it is still better not to greet him with “Shalom”, but instead to say “Good morning” or the like. The early Rabbis acted in this way in order to keep in mind that they still hadn't prayed (Mishneh Berurah). If, however, one already began to recite the morning blessings, then it is fine to follow the letter of the law in the above cases and say “Shalom” (a. if seeing him in the street; b. happens to be passing his home; c. or at the Synagogue). (Shulchan Aruch 89:2; Acharonim)
The above prohibition against saying “Shalom” before prayer applies even to one’s father or rabbi. Also, the above restriction applies only when one wants to greet his fellow first. If, however, the other person says “Shalom” first it is permissible to answer back “Shalom” in all instances. (Mishneh Berurah)
If one must go to the home of someone whom he is afraid will become angry and possibly become violent, he should try to get by with shaking his hand without saying “Shalom”, but if he passes him on the street he need not be strict and can say “Shalom” according to halacha.
The Kaf HaChaim writes that it is also forbidden to send one a gift before praying, and also not to kiss one’s children before praying, especially in the synagogue.
- Sources: Shulchan Aruch 89:2, as explained by the later rabbis