She narrated that the Messenger of Allah ﷺ said, "It is not lawful for a woman who believes in Allah and the Last Day," or, "in Allah and His Messenger, to mourn for any deceased person more than three days, except for a husband."
حدثنا يزيد بن هارون قال أخبرنا يحيى بن سعيد عن نافع أن صفية ابنة أبي عبيد أخبرته أنها سمعت
تحدث أن رسول الله ﷺ قال لا يحل لامرأة تؤمن بالله واليوم الآخر أو بالله ورسوله أن تحد على ميت فوق ثلاث إلا على زوج
Its isnad is sahih. Safiya bint Abu Ubayd is the wife of Ibn Umar, she has a narration, and she is among the senior female Successors, her hadith appearing in the Sahih and the Sunan collections. The hadith was reported by Muslim, 2/1126, no. 1486, Nasai, 6/189, no. 3503, Ibn Majah, 1/674, no. 2086, and Malik, 2/598, no. 104, all of them in the chapter on divorce.