[Machine] Punishment is a form of discipline that has no limits from the limits set by Allah. It used to be permissible to abandon it unless there were matters that were done during the time of the Messenger of Allah that were outside of the limits and were not given a punishment, such as looting in the cause of Allah and other things. No punishment was imposed and he forgave. It is said that Umar ibn al-Khattab sent [someone] to a woman concerning something that he had heard from her, and she was divorced. He sought advice and someone said to him, "You are the one who disciplines." Ali said to him, "If he tried his best, then he made a mistake, but if he did not try his best, then he deceived you regarding the dowry." He said, "I have resolved not to sit until I strike her among your people." He said, "Ali ibn Abi Talib said, 'No one dies under a punishment and I find something of it in myself. The truth is that his killing is not permissible unless he dies under the punishment of alcohol, for it is something that we have seen after the Prophet. So whoever dies in it, his ransom is either to be taken from the treasury or to be taken from the discretion of the Imam.'"
التَّعْزِيرُ أَدَبٌ لَا حَدٌّ مِنْ حُدُودِ اللهِ وَقَدْ كَانَ يَجُوزُ تَرْكُهُ إِلَّا أَنْ يَرَى أُمُورًا قَدْ فُعِلَتْ عَلَى عَهْدِ رَسُولِ اللهِ ﷺ كَانَتْ غَيْرَ حُدُودٍ فَلَمْ يَضْرِبْ فِيهَا مِنْهَا الْغُلُولُ فِي سَبِيلِ اللهِ وَغَيْرُ ذَلِكَ وَلَمْ يُؤْتَ بِحَدٍّ قَطُّ فَعَفَا قَالَ وَقِيلَ بَعَثَ عُمَرُ بْنُ الْخَطَّابِ ؓ إِلَى امْرَأَةٍ فِي شَيْءٍ بَلَغَهُ عَنْهَا فَأُسْقِطَتْ فَاسْتَشَارَ فَقَالَ لَهُ قَائِلٌ أَنْتَ مُؤَدِّبٌ فَقَالَ لَهُ عَلِيٌّ إِنْ كَانَ اجْتَهَدَ فَقَدْ أَخْطَأَ وَإِنْ لَمْ يَجْتَهِدْ فَقَدْ غَشَّ عَلَيْكَ الدِّيَةُ قَالَ عَزَمْتُ عَلَيْكَ أَنْ لَا تَجْلِسَ حَتَّى تَضْرِبَهَا عَلَى قَوْمِكَ قَالَ وَقَالَ عَلِيُّ بْنُ أَبِي طَالِبٍ ؓ مَا أَحَدٌ يَمُوتُ فِي حَدٍّ فَأَجِدُ فِي نَفْسِي مِنْهُ شَيْئًا الْحَقُّ قَتْلُهُ إِلَّا مَنْ مَاتَ فِي حَدِّ خَمْرٍ؛ فَإِنَّهُ شَيْءٌ رَأَيْنَاهُ بَعْدَ النَّبِيِّ ﷺ فَمَنْ مَاتَ فِيهِ فَدِيَتُهُ إِمَّا قَالَ عَلَى بَيْتِ الْمَالِ وَإِمَّا قَالَ عَلَى عَاقِلَةِ الْإِمَامِ