3.Menachos 33a (Beraisa): If a doorframe was made of reeds, one cuts a tube-shaped opening and inserts the Mezuzah in it.

4.(Rav Acha brei d'Rava): He must do it in this order. If he cut the hole, inserted the Mezuzah and then attached the frame to the door, it is Pasul. One must affix the Mezuzah to the doorpost, but not attach a doorpost with a Mezuzah to the opening.

(b)Rishonim

1.Mordechai (Avodah Zarah 810): Mezuzah is an obligation on the resident. I.e. if he does not live there, he is exempt, even if it is his house. We require both (it is his house, and he lives there). Do not say that it is an obligation on the resident even if he does not own the house. One who borrows or rents a house in Chutz la'Aretz is exempt until 30 days. If mid'Oraisa he is obligated even though it is not his, why is he exempt for 30 days? Rather, we expound "Beisecha", and not another's house. After 30 days he is obligated mid'Rabanan, for people think that it is his. Alternatively, the Torah always obligates him, even if it is not his. Only a fixed residence is obligated. Until 30 days it is not fixed.

i.Nimukei Yosef (Hilchos Mezuzah (after Menachos) 6b DH veha'Dar): One who rented a house for less than 30 days in Chutz la'Aretz is exempt from a Mezuzah.

(c)Poskim

1.Magen Avraham (19:1): One must bless on a Mezuzah when affixing it, even though one is exempt until he lives there. Why is attaching Tzitzis different? Normally, one affixes a Mezuzah when he lives there, therefore he blesses when he affixes it. One normally attaches Tzitzis before wearing the garment. Therefore, he does not bless on attaching them. Indeed, if one was wearing Tzitzis and they snapped, he blesses Asher Kidshanu b'Mitzvosav v'Tzivanu La'asos Tzitzis on attaching them, similar to a Mezuzah. Perhaps if one affixes a Mezuzah before living there, when he enters to live he blesses Asher Kidshanu... Ladur b'Bayis she'Yesh Bo Mezuzah.

i.Machatzis ha'Shekel: This is because the final Mitzvah is only when he lives there.

ii.Birkei Yosef (19:2): It is difficult to make a new Berachah not mentioned in the Gemara or Poskim! Yad Aharon says that writing a Mezuzah is like attaching Tzitzis, and affixing a Mezuzah is like wearing a Talis. I disagree. The Mitzvah begins when he enters to live. This is like putting on the Talis! Rather, for Tzitzis, the final Mitzvah is wearing them. At the time, he engages in the Mitzvah, i.e. puts on the Talis. One who affixes a Mezuzah does not engage in it afterwards. Chachamim did not enact to bless when one does not engage in the Mitzvah, rather, for the final engagement in it. If one moved into a house with a Mezuzah, he fulfills the Mitzvah, but he did not engage in it, so he does not bless. Toras Chesed (53) says not to bless on affixing a Mezuzah within 30 days. It seems that all the more so, one should not affix it before coming to live in the house. The Magen Avraham connotes that one may affix it and bless before moving in. One must investigate this.

iii.Ha'aros on Birkei Yosef (OC 19:2): Amudei Aharon (p.228) derived from the Mordechai that as long as one did not enter a house, he need not affix a Mezuzah. He was unsure about the Nimukei Yosef (who connotes that one who rents in Chutz la'Aretz for more than 30 days is obligated immediately - PF), and was astounded that the Birkei Yosef did not mention them. I say that the question is not whether it is obligated, rather, whether it helps, or if it is "Ta'aseh", v'Lo Min ha'Asuy (it is as if he did not do the Mitzvah, rather, it happened by itself), for he was not yet obligated [when he affixed it]. The Mordechai said only that one need not affix it. He did not teach about one who affixed it.

iv.Question: May one who enters a house in Chutz la'Aretz affix a Mezuzah with a Berachah within 30 days?

v.Answer (Hilchos Ketanos 2:95): One might have thought to equate this to blessing on Talis and Tefilin. One may not bless on them before their time. However, there all agree that it is not yet the time. Here, it is the time. Pesachim 69 (perhaps this should say 72 - PF) makes such a distinction regarding a Heter to be Mechalel Shabbos for Bris Milah.

vi.Chikrei Lev (YD 3:128, DH umi'Tzad): If one affixes a Mezuzah when he was exempt, perhaps he did not do the Mitzvah, like one who cut a hole, inserted the Mezuzah and then attached the frame to the door. When the Reish Galusa asked Rav Nachman to affix a Mezuzah on his new house, Rav Nachman said that first he must attach the doorposts (Menachos 33a). Rashi explains that if not, it will be Ta'aseh v'Lo Min ha'Asuy. See Mahara Sason 232. If so, if a Mezuzah was attached before there was Chiyuv, one must remove it and re-attach it. However, if one put on Tefilin at night due to a need, when the time comes, he feels them and blesses (Tur OC 30). R. Peretz holds that this is even like the opinion that there is no Mitzvah at night. Feeling them is like putting them on. The Beis Yosef (OC 8) says that if one put on a Talis at night, when the time comes, it suffices to feel them and bless. Even Ri, who argues, says that this is the custom. We hold that night is not Zman Tzitzis! Regarding Ner Chanukah, one must extinguish and relight it! I answer that we hold that the Chiyuv is on the garment (Note - all the Poskim rule that the Chiyuv is on the person. Perhaps this is a printing mistake - PF.) Therefore, he need not remove it. If he removed it, he need not wear it. All the more so, we do not obligate him to remove it and wear it in order to bless. It suffices to feel it in order to bless. For Tzitzis, Ta'aseh v'Lo Min ha'Asuy applies to attaching the strings, and not to wearing it. A Mezuzah attached when exempt is invalid. How did Chachamim command a renter in Eretz Yisrael to immediately affix a Mezuzah, for the sake of Yishuv Eretz Yisrael? He will not fulfill the Mitzvah when the time comes! Rashi (Berachos 48) says that one who ate a k'Zayis, and is obligated mid'Rabanan to bless, can exempt a Torah Chiyuv of one who ate to satiation. If so, a Chiyuv mid'Rabanan of Mezuzah can exempt the Torah Chiyuv that comes later. The other Poskim must say that according to the opinion that after 30 days it is a Torah Chiyuv, one must remove the Mezuzah and attach it again. If we say that Ta'aseh v'Lo Min ha'Asuy applies only to Mechusar Ma'aseh (an action needed to be done), but not to Mechusar Zeman, there is no problem. This requires investigation.

vii.Tosefes Bikurim (at the end of Aruch l'Ner Sukah, 625:4): The Pri Chodosh holds that if one removes the lintel above door and puts Schach there, and the doorposts and the Mezuzah remain, after Sukos when one puts on a proper lintel again, one must remove the Mezuzah and attach it again with a Berachah, for this is Ta'aseh v'Lo Min ha'Asuy (when there was no lintel above, it was exempt). Teshuvos Arba'ah Turei Even disagrees, for initially it was affixed when it was obligated. He learns from Siman 15 and our Siman. Even without this, Ta'aseh v'Lo Min ha'Asuy does not apply, for the doorway is obligated the rest of the year. I say that since it was made Kosher, Ta'aseh v'Lo Min ha'Asuy does not apply. The Rema (626:3) is Machshir a Sukah made under a roof that can be opened if it was open at the time, even though later it is closed. If one affixed the Mezuzah during Sukos, perhaps he must detach it and reaffix it after Sukos. Or, perhaps Ta'aseh v'Lo Min ha'Asuy applies only to something that was intrinsically Pasul for the Mitzvah, e.g. Tzitzis on a three cornered garment or a Mezuzah affixed before a doorway was carved out. If not, according to the Rambam, Tzitzis attached at night would be Pasul. Rather, it is not a problem because the object was Kosher, just it was not time for the Mitzvah. The Magen Avraham compares Tzitzis to Mezuzah.

viii.Yabi'a Omer (8 OC 3:4): Agurah b'Ohalecha (36b) wrote that one who rents a house in Chutz la'Aretz, who is exempt from Mezuzah for 30 days, may affix it in this time and leave it there after 30 days. This is not Ta'aseh v'Lo Min ha'Asuy. This is unlike putting Tzitzis on a three cornered garment, and later adding a fourth corner. That is Ta'aseh v'Lo Min ha'Asuy, for it was Mechusar Ma'aseh. The Mezuzah is not Mechusar Ma'aseh. The time comes automatically. Also Da'as Kedoshim (YD 286:34) says so. This is like putting Tzitzis on a garment before wearing it, or putting Schach on the Sukah before the Chag, since the time comes automatically. Harei Besamim (2:219, b'Sof) says that regarding Mezuzah, Ta'aseh v'Lo Min ha'Asuy is only if he cut a hole, inserted the Mezuzah and then attached the frame to the door. There is no Chiyuv at all until the frame was attached. Here, a Chiyuv can come through one who will fix his residence there. Even though this person did not yet fix there, Ta'aseh v'Lo Min ha'Asuy applies only when the matter is Mechusar Ma'aseh to fix it. Here, only time is lacking, and this comes by itself (Pesachim 90b). The Pri Megadim (OC 18) is Machshir Tzitzis made at night. It is not Ta'aseh v'Lo Min ha'Asuy, for time comes by itself. It is unlike putting Tzitzis on a three cornered garment. The same applies to a Mezuzah attached within 30 days. However, Chikrei Lev was undecided at the end. The Minchas Chinuch (423) said that perhaps one may affix a Mezuzah before 30 days, like Acharonim say about attaching Tzitzis at night. Several Acharonim distinguish Mechusar Ma'aseh from Mechusar Zeman. It seems that Ta'aseh v'Lo Min ha'Asuy is only when the matter itself is not proper for the Mitzvah, but not to attaching Tzitzis at night, or fixing a Mezuzah during Sukos on a room that serves a Sukah.