Ka’b on Ramadan: Whoever fasts intending to sin after Ramadan

Ibn Rajab reported: Ka’b ibn Malik, may Allah be pleased with him, said, “Whoever fasts the month of Ramadan and he says to himself that he will return to sinful disobedience when Ramadan is over, his fasting is rejected.”

Source: Laṭā’if al-Ma’ārif 1/222

عن ابن رجب قَالَ كَعْبْ بْنُ مَالِكٍ رَضِيَ الله عَنْهُ ‏مَنْ صَامَ رَمَضَـانَ وَهُوَ يُحَدِّثُ نَفْسَـهُ أَنَّهُ إِذَا خَرَجَ رَمَضَـانُ عَصَىٰ رَبَّهُ فَصِيَامُهُ عَلَيْهِ مَـرْدُوْدٌ

1/222 لطائف المعارف لابن رجب