Isma'il bin Abd al-Rahman bin Atiyyah narrates from his grandmother, Sayyidah Umm Atiyyah (may Allah be pleased with her), that when the Prophet (peace and blessings be upon him) came to Madinah, he gathered the women of the Ansar in a house and sent Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) to them. He stood at the door and greeted us with salam, and we returned his greeting. Then he said: I am the messenger of the Messenger of Allah (peace and blessings be upon him) to you. We said: Welcome to the Messenger of Allah (peace and blessings be upon him) and to his messenger. Then he said: Will you pledge that you will not associate anything with Allah, and will not steal or commit adultery? We said: Yes. He stretched out his hand from outside the house and we stretched out our hands from inside the house. Then he said: O Allah, bear witness. And we were ordered that for the two Eids the menstruating women and the young women should come out, but the Friday prayer is not upon us, and we were forbidden from following funerals. Isma'il (may Allah have mercy on him) said: I asked my grandmother what is meant by "and will not disobey you in what is right" [Surah al-Mumtahanah: 12]. She said: He (peace and blessings be upon him) forbade us from "wailing (over the dead)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجمعة / 5637