Kitzur Shulchan Aruch Chapter 11 Paragraph 2

The Laws of Mezuzah

סעיף ב גַּם שַׁעֲרֵי חֲצֵרוֹת וּמְבוֹאוֹת וַעֲיָרוֹת וּמְדִינוֹת, חַיָּבִין בִּמְזוּזָה, שֶׁנֶּאֱמַר, וּבִשְׁעָרֶיךָ (ועיין לקמן סעיף טז 

Kitzur 2

Also, the gates of courtyards, streets, cities, and provinces are required to have mezuzot, as the Torah states: “and on your gates.”[1]

Upon Your Gates

“Gateways” are radically different than the doors of houses. A gateway to a province may be an isolated structure straddling a main road, without any walls to its side. In fact, Rashi gives an example of such a provincial gate that is surrounded by the wilds of a forest.[2]

Likewise, city gates may or may not be part of a walled enclosure. The Rishonim question how the gates into these areas would deserve mezuzah placement since they do not meet the basic conditions outlined in our introduction.

Rabbeinu Asher opines that the Torah obligates gateways to these areas according to their own norms, which are obviously different from the criteria pertinent to houses. For example, he explains that a ceiling is a necessary feature of a house, but not of a courtyard.[3]

In contrast, Rambam maintains that gates into these areas do not qualify for mezuzah placement in their own right. They only need mezuzot when they lead ultimately to a dwelling.[4]

[1] Devarim 6:9.
[2] Rashi, Yoma 11a.
[3] Rosh, Hilchos Mezuzah 11.
[4] Rambam, Hilchos Sefer Torah 6:8.