I have a door which takes up all the space of the front doorway/doorpost and there is no place for me to put the Mezuzah by the doorpost which is in front of the door. Should I place the Mezuzah by the doorpost behind the door, or should I place it on the side of the front doorpost?
While both options are not ideal, as there are Poskim who invalidate both placing a Mezuzah behind the door, as well as placing the Mezuzah in front of the door, but not within the doorpost but rather on top of it, or next to it, in such a case, it is better to place the Mezuzah behind the door within the doorpost, then in front of the door, but on top of the doorpost, or to its side. In the event that you already placed the Mezuzah in front of the doorpost, on top of it, then you should move it without a blessing to the doorpost that is behind the door.
Sources: See Michaber Y.D. 289:2 for requirement to place within vacuum of doorpost, and ruling of Rama ibid that if one swerved from this it is not invalid so long as it was placed by the doorpost; Shach Y.D. 289:3 for dispute regarding placing behind door; Yad Haketana Mezuzah 3:11 and his Biur of Minchas Ani 19 that placing on top of the doorpost frame not within the doorpost is invalid according to all; Mikdash Me’at 289:9; Sheilas David Y.D. 9 that this matter is noty properly explained in Shulchan Aruch; Chovas Hadar 9 footnote 22; Pischeiy Shearim 289:30; Kevius Mezuzah Kehilchasa 11:2 and footnotes there that in a case of need one may place it on the side of the doorpost within one Tefach of it; Pischai Mezuzah [Chazan] 289:13 and in Biurim there on pp. 112-116, and in Beis Mezuzah 125:5-9 that it is invalid according to most Poskim to place on top of doorpost, and thus in above case place behind door; Mezuzah [Bressman] p. 207; Mishnas Kohen p. 15