הלכות מזוזה
מצות עשה לכתוב פרשת שמע והיה אם שמוע ולקובען על מזוזת הפתח דכתיב וכתבתם על מזוזות ביתך ובשעריך וצריך ליזהר מאד בה כמו שאחז"ל כל מי שיש לו תפילין בראשו ובזרועו וציצית בבגדו ומזוזה בפתחו מוחזק הוא שלא יחטא מפני שיש במזוזה יחודו של הקב"ה ותמיד בבואו ובצאתו יזכור יחודו של הקב"ה ויתן יראתו על פניו לבלתי יחטא וכל הזהיר בה יאריכו ימיו וימי בניו דכתיב למען ירבו ימיכם וימי בניכם ואם אינו זהיר כה יתקצרו דמכלל הן אתה שומע לאו וכן דרשו חכמים בעון מזוזה בניו ובנותיו מתים קטנים דכתיב דם נפשות אביונים נקיים וסמיך ליה לא במחתרת מצאתים וגדולה מזה שהבית נשמר על ידה כמו שדרשו בפסוק ה' שומרך וגומר מלך ב"ו מבפנים ועבדיו שומרין אותו מבחוץ ואתם ישנין על מטתכם והקב"ה שומר אתכם מבחוץ וע"כ נתינתה בטפח החיצון שיהא כל הבית לפנים הימנה ובשמירתה ומ"מ לא יהא כוונת המקיימה אלא לקיים מצות הבורא יתעלה שצונו עליה: The Laws of Mezuzah
It is a positive commandment to write the sections of Shema (Deuteronomy 6:4-9), and of Vehayah Im Shemoa (Deuteronomy 11:13-21), and to affix them upon the doorposts of the entrance, as it is written: And you shall write them on the doorposts of your house and on your gates (Deuteronomy 11:20). And one needs to be very careful with it. It is as the sages, may their memory be blessed, said, "Anyone who has tefillin on his head and on his arm, tzitzit on his garment, and a mezuzah on his entrance is assumed to not sin" (Menachot 43b). That is because the mezuzah has the unification of the Holy One, blessed be He, in it, and he will always remember the unification of the Holy One, blessed be He, in his coming in and in his going out, and place the fear of [God] in front of him so that he will not sin. And anyone careful about it will have his days and the days of his children lengthened, as it is written: In order that your days and the days of your children will be multiplied (Deuteronomy 11:21). But if one is not careful about it, they are shortened. As from the positive [statement], I understand the negative [implication]. And likewise did the sages expound, "For the sin of mezuzah do a person's sons and daughters die when they are young, as it is written: the blood of the souls of the innocent poor (Jeremiah 2:34), and next to it is: you did not find them breaking in [which relates to an improvised entrance lacking a mezuzah]" (Shabbat 32b). And greater than this is that the house is guarded by it, as they expounded on the verse: The Lord is your Guardian, etc. (Psalms 121:8), "A flesh and blood king is inside and his servants protect him from the outside, whereas you sleep in your beds, and the Holy One, blessed be He, guards you from the outside." Hence their placement is on the outer handbreadth, such that all of the house be inside from it and its guarding. Nevertheless, the intention of the one fulfilling it should only be fulfill the commandment of the Creator, may He be exalted, who commanded us about it.