Hazrat Saeed bin Al-Musayyib says that a person in a state of major impurity (junub) may pass through the mosque but may not sit in it.