Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:1530Abū ʿAbdullāh al-Ḥāfiẓ > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > al-Rabīʿ

[Machine] Imam al-Shafi'i, may Allah have mercy on him, said in his book "Rulings of the Qur'an": If a man has intercourse with his wife while she is menstruating or after the period has ended and she has not yet performed ghusl (ritual bath), he should seek forgiveness from Allah, the Most High, and should not resume sexual relations until she becomes purified and becomes permissible for him to pray. It has been narrated that there is something in this matter that, if confirmed, we would take into consideration. However, it is not confirmed.  

البيهقي:١٥٣٠أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ أنا الرَّبِيعُ قَالَ

قَالَ الشَّافِعِيُّ رَحِمَهُ اللهُ تَعَالَى يَعْنِي فِي كِتَابِ أَحْكَامِ الْقُرْآنِ فِيمَنْ أَتَى امْرَأَتَهُ حَائِضًا أَوْ بَعْدَ تَوْلِيَةِ الدَّمِ وَلَمْ تَغْتَسِلْ يَسْتَغْفِرُ اللهَ تَعَالَى وَلَا يَعُودُ حَتَّى تَطْهُرَ وَتَحِلَّ لَهَا الصَّلَاةُ وَقَدْ رُوِيَ فِيهِ شَيْءٌ لَوْ كَانَ ثَابِتًا أَخَذْنَا بِهِ وَلَكِنَّهُ لَا يَثْبُتُ مِثْلُهُ