بقي هنا شيء وهو أن علة الإثم هل هي كون ذلك إستمتاعاً بالجزء كما يفيده الحديث وتقييدهم كونه بالكف ويلحق به ما لو أدخل ذكره بين فخذيه مثلاً حتى امنى أم هي سفح الماء وتهييج الشهوة في غير محلها بغير عذر كما يفيده قوله وأما إذا فعله لإستجلاب الشهوة إلخ ؟ لم ار من صرح بشيء من ذلك والظاهر الأخير لأن فعله بيد زوجته ونحوها فيه سفح الماء لكن بالإستمتاع بجزء مباح كما لو أنزل بتفخيذ أو تبطين بخلاف ما إذا كان بكفه ونحوه وعلى هذا فلو أدخل ذكره في حائط أو نحوه حتى امنى أو إستمنى بكفه بحائل يمنع الحرارة يأثم أيضاً ويدل أيضاً على ما قلنا في الزيلعي حيث إستدل على عدم حله بالكف بقوله تعالى ﴿ والذين هم لفروجهم حافظون ﴾ الآية وقال فلم يبح الاستمناع إلا بهما أي بالزوجة والأمة
رد المحتار على الدر المختار لإبن عابدين كتاب الصوم باب ما يفسد الصوم وما لا يفسده
One thing remains here, and that is the basis for the transgression – is it because the nature of it is enjoyment of one's member, like the hadith conveys, restraint from doing it with one's hand but following through with it, for example, if he puts his penis between his thighs until he ejaculates? Or is it the spilling of semen and arousing one's passion in somewhere other than the appointed place, without an excuse, as is conveyed by what he [Al-Haskafi] says here, this being if one does it to stir up desire, etc. ? I am not aware of anyone stating anything about this, although the latter is clearer, since in doing it with the hand of one's wife or someone like her, there is spilling of semen, although it is by enjoyment in a permissible fashion, such as if he ejaculates by thighing or belly rubbing, in contrast to with his own hand or something like that, including if he puts his penis into a wall or something similar until he ejaculates, or if he masturbates with his hand through a barrier that prevents erotic sensation; he transgresses nonetheless. This also attests to what we have said regarding Al-Zayla'i when he concluded that it is not lawful to do it with one's hand, according to the word of the Most High : { And those who guard their crotches } [Al-mu'minun 5] to the end of the verse; he said: Enjoyment has not been made permissible except with these two, that is, with a wife or a slave girl.
Ibn ‘Abidin, Radd Al-muhtar ‘ala Al-durr Al-mukhtar [Answer to the Perplexed over the Choicest Pearls], The book of fasting, Section: what invalidates the fast and what does not invalidate it