Excerpted and translated from Rabbi Ginsburgh's farbrengen, Purim 5780.
There is an ancient book of Kabbalah called Sefer Hapelee’ah. There is a great deal of discussion surrounding this book, when exactly it was written, and who wrote it. Of the latter sages, the sage who explored the depths of this book and delved into its secrets is Rabbi Shimshon Ostropoli (b. 1600). Rabbi Shimshon is considered to be a Mashiach ben Joseph figure. He was martyred in 1648 in the Khmelnytsky massacre, which he had foreseen. His great-grandson was Rabbi Yaakov Yosef of Polonne, the great disciple of the Ba'al Shem Tov. Some of his other descendants were also disciples of the Ba'al Shem Tov.
The Sefer Hapelee’ah says that there is a holy name of God written on the forehead of a tzaddik. The name is the word “You” (אַתָּה)—a direct overture to God's essence. When we recite a blessing, we turn to God directly, "Blessed are You God, Master of the universe…." If a tzaddik merits, the letters of the word “You” on his forehead become an overture to God's essence.
There is another reference to words written on the forehead. On the High Priest’s golden forehead plate (called the tzitz), the words “sanctified to God” (קֹדֶשׁ לי-הוה) were engraved. The forehead plate and its words served as a counterforce to the boldness and gall of Amalek; in Hebrew, “boldness” is idiomatically linked with the forehead and is called, “boldness of the forehead” (עַזּוּת מֵצַח). Amalek represents the chutzpah of the husk. Our war with Amalek thus pits our forehead—tied to holiness—against their forehead—filled with rebellion against all that is holy. In our times, politics is an arena in which the battle between foreheads is waged.
The words, “sanctified to God” are carried around by the High Priest on his forehead. He is both an emissary of God and an emissary of the people. The straightforward symbolism here is that the High Priest himself is holy and dedicated to God. But the word “You” that spiritually shines on the tzaddik's forehead and refers to God is thus even loftier than the High Priests, “sanctified to God.”
The Sefer Hapelee’ah goes on to describe another name written on the forehead; this time on the forehead of the Mashiach. There are holy names that are actual words that relate to God's essence. On the Mashiach's forehead, the word, “according to the law” (כַּדָּת) is written. This is one of the most important words in the Scroll of Esther.
The Power to Pass through Purgatory
Why is the word "You" written on the tzaddik’s forehead? The author of Sefer Hapelee’ah goes into a long explanation about purgatory. He writes that there are 850 chambers in purgatory. Someone who wants to go through purgatory and extricate and elevate souls from there must go through 850 chambers. The greatest tzaddik, the Mashiach, must pass through all those chambers to extricate the souls from them. The sages say, “The best of doctors—to purgatory.” Why does the Mashiach need to go into purgatory? Because he must heal all of the souls lost there and release them. The Arizal says that when Mashiach comes, everyone will have the power to extricate souls from purgatory, with the name “You” (אַתָּה) on their foreheads.
From among the 850 chambers, there are 580 chambers that do not present a danger for the tzaddik. This number, 850 is the value of the word “strong” (תֹּקֶף). This leaves 270 the value of “evil” (רָע) rooms that are evil and dangerous. How can a tzaddik get through these chambers?
The Sefer Hapelee’ah writes that there is an angel named “Joshua” (יְהוֹשֻׁעַ) who writes the name “You” (אַתָּה) on the tzaddik’s forehead in wax (שַׁעֲוָה). This immunizes the tzaddik from the danger in those 270 evil chambers so that he can extricate the holy souls of Israel from there. This, the Sefer Hapelee’ah says, is what Mashiach does.
The Source in Psalms 23
The stream of Kabbalah that we have been discussing is called Ashkenazic Kabbalah. Rabbi Shimshon of Ostropoli, similar to Rabbi Yosef Caro (known by his book as the Beit Yosef) had a maggid—an angel from whom he would learn Torah. The Arizal had a constant connection with Elijah the Prophet. It is written about the Ba'al Shem Tov that Elijah the Prophet did not move from his immediate presence. Rabbi Shimshon learned secrets of the Torah from the angel every day.
With his ru’ach hakodesh (holy spirit), Rabbi Shimshon explained the teaching in the Sefer Hapelee’ah about the 850 rooms, the 580 relatively harmless rooms, the 270 evil rooms, the angel, and the wax. He showed how they all emerge from a textual analysis of a verse from Psalms 23, one that is famous throughout the world, “Even when I walk in the valley of the shadow of death, I will not fear evil for You are with me. Your rod and Your staff will comfort me” (גַּם כִּי אֵלֵךְ בְּגֵיא צַלְמָוֶת לֹא אִירָא רָע כִּי אַתָּה עִמָּדִי שִׁבְטְךָ וּמִשְׁעַנְתֶּךָ הֵמָּה יְנַחֲמוּנִי).
The words “the valley of the shadow of death” (גֵיא צַלְמָוֶת) from this verse equal 580. Thus, the meaning of the verse becomes, even when I walk in, “the valley of the shadow of death,” i.e., in the 580 chambers of purgatory, “I will not fear evil,” I am not afraid, I can pass through those chambers safely. But when I get to the 270 chambers of evil (רָע) that remain, there is fear. Yet, still, I will not fear, “for You (אַתָּה) are with me.” The angel comes and writes “You” (אַתָּה) on the tzaddik's forehead. Then the tzaddik becomes Mashiach the son of David, who can elevate the souls from purgatory.
Now, the initial letters of the words “your rod and your staff [will comfort me]” (עִמָּדִי שִׁבְטְךָ וּמִשְׁעַנְתֶּךָ הֵמָּה) spell the word “wax” (שַׁעֲוָה) referring to the wax with which the word “You” is written on the tzaddik's forehead. When we add the next word, “will comfort me” (יְנַחֲמוּנִי) whose initial letter is a yud (י), to the four letters of “wax,” we get the name “Joshua” (יְהוֹשֻׁעַ), the name of the angel who writes the word “You” with the wax so that the tzaddik can go through the 270 evil chambers.
Considering this explanation by Rabbi Shimshon of Ostropoli, it is quite clear that he has discovered the source and meaning of this mysterious description from Sefer Hapelee’ah. The Sefer Hapelee’ah did not write a source for its teaching, but Rabbi Shimshon brings it all together with his wondrous insight into this famous verse.
 Likut Shoshanim 21.
 Ibid. 25.
 Esther 1:8, 1:15, 2:12, 4:16, and 9:13.
 Kiddushin 82a