courtyard. And the menstruating woman is prohibited from the mosque. It has been narrated from Ahmad what supports this. Al-Marrudhi narrated from him that the person in I'tikaf may go out to the courtyard of the mosque as it is part of the mosque. The Qadi said: If there is a wall and a door surrounding it, then it is like the mosque because it is joined with it and is an appendage to it; and if it is not enclosed, the ruling of the mosque does not apply to it. Thus, it is as if he reconciled the two narrations and applied them to two different situations. If he goes out to a minaret outside the mosque to perform the Adhan, his I'tikaf is void. Abu al-Khattab said: It is possible that it is not void, because the minaret of the mosque is like that which is connected to it.
531 - Issue; He said: (And whoever has sexual intercourse has spoiled his I'tikaf, and there is no atonement (qada') upon him, unless it was obligatory).
The totality of this is that sexual intercourse during I'tikaf is forbidden by consensus, and the basis for this is the saying of Allah the Almighty: {And do not have relations with them while you are staying for worship in the mosques. These are the limits of Allah, so do not approach them} (1). If he has intercourse in the vagina intentionally, he spoils his I'tikaf, by the consensus of the people of knowledge. Ibn al-Mundhir narrated this from them. This is because when sexual intercourse is forbidden in an act of worship, it spoils it, like the Hajj and fasting. If he was forgetful, then it is the same according to our Imam, Abu Hanifah, and Malik. Al-Shafi'i said: His I'tikaf is not spoiled; because it is physical contact that does not spoil the fast, so it does not spoil the I'tikaf, like physical contact in areas other than the vagina. To us, what is forbidden in I'tikaf is equal in its intentional and forgetful state regarding its invalidation, like exiting the mosque, and we do not concede that it does not spoil the fast. Furthermore, physical contact short of the vagina does not spoil the I'tikaf unless it is accompanied by ejaculation. Once this is established, there is no atonement (kaffarah) for sexual intercourse in the apparent view of the school (Madhhab). This is the apparent meaning of al-Khiraqi's words. And it is the view of 'Ata', al-Nakha'i, the people of Medina, Malik, the people of Iraq, al-Thawri, and the people of the Levant,
(1) Surah al-Baqarah 187.