2 Answers
2

The Rama, however, mentions that one should just put his hand on the Mezuza. (As a side note, the Lubavitcher Rebbe used to put his hand on the Mezuza without kissing it).

The Rama brings a source from the Gemara in Avoda Zara where it relates that when Onkulus was being arrested and let out of the house, he put his hand on the Mezuza. When asked the meaning of the Mezuza, Onkeles answered that in contrast to a human king who is guarded by his servants, Hashem guards his servants.

Onkelos the son of Kalonymus became a proselyte. The emperor sent a contingent of Roman [soldiers] to pursue him, but he enticed them by [citing] Scriptural verses, and they converted to Judaism. The Emperor then sent another Roman cohort, instructing them not to say anything to him. As they were about to take him into custody, he said to them: “Let me tell you . . . ,” and they too converted. He [the emperor] dispatched another cohort and ordered them not to engage in any conversation with Onkelos. As they seized him and were walking, Onkelos saw the mezuzah affixed to the doorway. He placed his hand on it and asked them, “What is this?” They said, “You tell us.” Onkelos replied, “The universal custom is a mortal king dwells within and his servants keep guard over him from without; but with the Holy One, Blessed be He, His servants dwell within while He keeps guard over them from without, as it says, ‘Hashem yishmor tzetcha u’vo’echa me’atah v’ad olam, The Lord will guard your goings and your comings, from now and forever’” (Psalms 121:8). They too converted to Judaism. He [the emperor] sent for him no more.

However the first source that states that one should engage in this practice is the Arizal

I definitely appreciate your adding the full story, and the citation in the Arizal. +1 for both of those. The other answer still contains more information, so I will keep that as the selected answer. In any event, welcome to M.Y., and thanks for the great answer; I hope you stick around and provide more great answers to great questions (and great questions of your own).
–
Seth JJul 16 '14 at 16:42

1

@ShmuelBrin they are contemporaries however the Rama's Mapa was not published until after the death of both himself and the Ari whereas the Arizal's customs where widely disseminated during his lifetime which is why I assumed it to be an earlier source.
–
user6641Jul 16 '14 at 17:45