—when taking leave as well—on account of the Prophet ﷺ saying:
“When any one of you enters the mosque, let him greet (with salām), and when he leaves, let him greet; the first occasion is no more entitled to it than the second.”
Abū Dāwūd, al-Tirmidhī, and others narrated it with a hasan (fair) chain.
Therefore, the claim made by some that shaking hands at the moment of parting is an innovation has no basis. Admittedly, whoever surveys the aḥādīth on handshaking at the time of meeting will find them more numerous and stronger than those concerning handshaking at parting. A jurist of discerning mind will conclude from this that the second handshake does not enjoy the same rank as the first: the former is a Sunnah, while the latter is merely recommended. To call it an innovation, however, is unfounded, in light of the evidence we have cited.
As for the handshake immediately after the prescribed prayers, it is indisputably an innovation—except when it occurs between two people who had not met before the prayer; in that situation it remains Sunnah, as you already know.
- “The Prophet of Allah, Ayyūb ﷺ, endured his trial for 18 years, and both those near to him and those far abandoned him—except for two of his brothers who used to visit him morning and evening. One day one of them said to the other, ‘By Allah, you know that Ayyūb must have committed a sin that no one in the whole world has ever committed.’ His companion asked, ‘And what is that?’ He replied, ‘For 18 years Allah has not shown him mercy by removing what afflicts him.’
“When the two came to Ayyūb, the man could not keep from telling him what he had said. Ayyūb answered, ‘I do not know what you two are talking about; I only know that Allah…’”}