The Messenger of Allah ﷺ used to teach them what to say when they went out to the graveyards. The one speaking among them would say, in the narration of Abu Bakr, "Peace be upon the inhabitants of these dwellings," and in the narration of Zuhayr, "Peace be upon you, inhabitants of these dwellings, from among the believers and the Muslims. We will, Allah willing, be joining you. I ask Allah for well-being for us and for you."
حدثنا أبو بكر بن أبي شيبة وزهير بن حرب قالا حدثنا محمد بن عبد الله الأسدي عن سفيان عن علقمة بن مرثد
كان رسول الله ﷺ يعلمهم إذا خرجوا إلى المقابر فكان قائلهم يقول في رواية أبي بكر السلام على أهل الديار وفي رواية زهير السلام عليكم أهل الديار من المؤمنين والمسلمين وإنا إن شاء الله للاحقون أسأل الله لنا ولكم العافية