that if they say “as-salāmu ʿalaykum” in clear words, you may answer, “wa ʿalaykum as-salām.”
As for open sinners: if shunning them is likely to bring about some benefit—namely, that they give up their sin—then go ahead and shun them. But if no benefit is expected, then shunning them is forbidden, because they are believers. And since they are believers, the Prophet (peace and blessings be upon him) said: “It is not lawful for a man to boycott his believing brother for more than three days. They meet, each turns away from the other, and the better of the two is the one who initiates the greeting.” When a boycott does serve a useful purpose—restraining them from sin and causing them to desist—then it is prescribed, either as an obligation or as a recommended act.
Consider the benefit that came from boycotting Kaʿb ibn Mālik (may Allah be pleased with him) and his two companions when they lagged behind the expedition to Tabūk: how their faith was reinforced, how patiently they endured their trial, and how they awaited relief from Allah until they attained a reward greater than any other—the very words of the Lord of all worlds, recited night and day by every Muslim, even within the prayers. Who among humankind receives mention in both the obligatory and supererogatory prayers? “And [He forgave] the three who were left behind, until the earth, vast as it is, became constricted for them, and their own souls were constricted for them, and they realized that there is no refuge from Allah except in Him; then He turned to them so that they might repent. Surely Allah is the Ever-Relenting, the Merciful” (al-Tawbah 9:118). This is a decisive text—even though their names are not stated explicitly—yet