Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.023A.
Abdullah ibn Ja’far reported that the Messenger of Allah, peace be upon him, said: “Prepare some food for the family of Ja’far, for what has befallen them is keeping them preoccupied.” This is narrated by Abu Daw’ud, Ibn Majah and Tirmizhi, who grades it as a sound hadith.
The Prophet, peace be upon him, recommended this practice for it is an act of virtue and kindness and brings friends and neighbours closer to each other.
Ash-Shafi’i said: “It is recommended that the relatives of the deceased prepare enough food to feed all the deceased’s family for one day and night, for it is the sunnah of the Prophet, peace be upon him, and a practice of good people.”
The scholars hold it commendable to urge the deceased’s family to eat so that their sorrow or excessive grief will not cause them to avoid food and thereby become weak. These scholars also hold that to offer food to the women while they are mourning loudly is not permissible, for it would be helping them in something sinful.
All the schools of Islamic law disapprove of the deceased’s family preparing food for the people coming to pay their condolences, for it adds to their grief and further encumbers them unnecessarily. Such a practice would also resemble the custom of the Arabs before Islam. Referring to this practice, Jarir says: “(In those days) we considered it a part of mourning to assemble at the deceased’s house and prepare food after burial for those gathered there.” Some scholars consider this to be absolutely forbidden (haram).
Ibn Qudamah observes: ‘It is permissible, however, when there is genuine need for it, since sometimes people attending the funeral may be from distant places, and they have to stay with the family of the deceased, in which case the family has to host such guests.