(26) CHAPTER. If somebody commits a sin which is less than what deserve the legal punishment; and then informs the ruler, no punishment is to be inflicted on him after his repentance to Allah if he comes to the ruler with the intention of asking for a verdict about his sin.
Narrated Abu Huraira: A person had sexual relation with his wife in the month of Ramadan (while he was fasting), and he came to Allah's Apostle seeking his verdict concerning that action. The Prophet said (to him), Can you afford to manumit a slave? The man said, No. The Prophet said, Can you fast for two successive months? He said, No. The Prophet said, Then feed sixty poor persons.
Authentic