בבא בתרא סט.
"מלבנות של פתחים מהו? דנקיטי בסיכי? תיקו"
Rav Elazar asks a question: Are the moldings around a door, which the door strikes when it is closed, included in the sale of a house or not? Things that are attached to the house with cement, are certainly viewed as part of the house and are included in the sale. But since these are attached by (removable) pegs and are not so integral to the door, maybe they should not be considered מחובר and therefore not included? The Gemara remains with a תיקו. The שו"ע [חו"מ ס' ריד,יא] paskens that anything מחובר to a house with cement is included in the sale, but he then brings a י"א that if it’s attached to the house by pegs, then it is not considered מחובר and therefore not included in the sale unless the מוכר clearly stipulated and stated, "עם כל מה בתוכו". The סמ"ע explains the reason it is not included is, since the Gemara remained with a תיקו, the לוקח is the מוציא and המוציא מחבירו עליו הראיה.
The [ה'] פתחי תשובה brings the תשובת שיבת ציון (son of the נודע ביהודה) that even though מזוזות are only attached with nails and according to our Gemara should not be included in the sale, this is only relevant to items the מוכר could be מחזיק even after the sale, but since he’s not permitted to remove the מזוזות and all he would have on them is a תביעת ממון, if he doesn’t clearly exclude them, the לוקח is considered the מוחזק and need not pay for them. The [ח"ב יו"ד ס' קנט] שבט הלוי brings this שיבת ציון and says that מזוזות are not the same as מלבנות. In our Gemara the doorstops are part of the house and are needed; the only שאלה is if the מוכר didn’t say כל מה שבתוכו, since they are only attached by pegs, maybe they should not be included. But the מזוזות that the מוכר installed are not חלק הבית nor are they שייך to the בנין הבית, rather they are a מצוה for the tenant (חובת הדר). The reason the מוכר can’t take them down, is only לטובת הלוקח, to protect him from מזיקים, but פשיטא that the מוכר has a טענת דמים on them. He concludes that even according to the svara of theשיבת ציון, if the seller wants he may replace the existing מזוזות with cheaper ones, so even if he doesn’t, he is entitled to be reimbursed the difference between the expensive ones he’s leaving and cheaper ones. ר' משה [אג"מ יו"ד ח"ד ס' מד] was asked by someone who was leaving his apartment and wanted to take his מזוזות with him. These מזוזות were very חשוב and dear to him as they were especially made for him by his son-in-law who was a ירא שמים and had stopped writing mezuzos. ר' משה discusses the pertinent halachos, but concludes that he may rely on הגאון ר' הענקין זצ"ל. He had said that since it has become the דרך that when a new tenant moves in, the apartment is freshly painted, the מזוזות must be taken off for protection. So, once they are off one may keep them. And ממילא, even if it hasn’t been rented yet, the tenant that is leaving may take them, even though it might be a few days before the painting begins.