Abu ʿĀmir narrated: Sulaymān ibn Bilāl transmitted the report in the same form, except that he said, “I heard Abu Ḥumayd and Abu Usayd both say it,” thereby combining the two Companions. The first version is more likely to be correct and preferable, for most of those who narrate from Sulaymān ibn Bilāl follow it, and al-Darāwardī corroborated him on that wording without dissent—something not found in the other variants. Allah knows best.
Moreover, in the versions recorded by Abū Dāwūd, Ibn Mājah, al-Dārimī in one narration, and al-Bayhaqī there is the additional phrase: “and let him send blessings upon the Prophet ﷺ upon entering only.”
Abū ʿAwānah likewise recorded it in his Ṣaḥīḥ Musnad (1/414) in language similar to Abū Dāwūd’s, adding: “and when he leaves, let him send blessings upon the Prophet ﷺ,” as cited in Nuzul al-Abrār (p. 72).
Accordingly, this version is identical to the hadith of Abu Hurayrah.
Both narrations indicate that this remembrance is obligatory, and for that reason we said:
“This supplication is obligatory because the Prophet ﷺ commanded it when he said: ‘When one of you enters the mosque, let him send peace upon the Prophet ﷺ and say: O Allah, open for me the gates of Your mercy; and when he leaves, let him send peace upon the Prophet ﷺ and say: O Allah, protect me from the accursed Satan.’”
The hadith is reported through Abu Hurayrah and is corroborated by the narration of Abu Ḥumayd—or Abu Usayd—whose chains have already been cited above.