BAYHAQI 17066:
from Kutib —
[Machine] It was written to him about a man who was asked, "When did you start dealing with women?" He said, "Yesterday." They asked, "With whom?" He said, "My mother." He was told, "You are already dead." He said, "I did not know that Allah had forbidden adultery." So Umar ibn al-Khattab wrote that he should be sworn to not pursue what he did not know Allah had forbidden, and then he should be freed.
البيهقي ١٧٠٦٦:
عن كتب —
أَنَّهُ كُتِبَ إِلَيْهِ فِي رَجُلٍ قِيلَ لَهُ مَتَى عَهْدُكَ بِالنِّسَاءِ؟ فَقَالَ الْبَارِحَةَ قِيلَ بِمَنْ؟ قَالَ أُمِّ مَثْوَايَ فَقِيلَ لَهُ قَدْ هَلَكْتَ قَالَ مَا عَلِمْتُ أَنَّ اللهَ حَرَّمَ الزِّنَا فَكَتَبَ عُمَرُ ؓ أَنْ يُسْتَحْلَفَ مَا عَلِمَ أَنَّ اللهَ حَرَّمَ الزِّنَا ثُمَّ يُخَلَّى سَبِيلُهُ
hadithunlocked.com