Here is one version presented as a riddle on an Ask the Rabbi forum (link:
Dear Yiddle Riddle people: The following is a story I read about Rashi in a child's Hebrew biography in perhaps fourth grade. Nobody I know has been able to solve the question without help. Rashi (Rabbi Shlomo ben Yitzchak) once went on a journey to a foreign city. On his trip, he wanted to visit a wealthy man to collect money for poor people. When he visited, the man was not at home, but his servant was. The servant said that he recognized the great Rashi as a thief who had previously run off with a set of his master's clothing and forced Rashi to pay for the clothing! Rashi wrote the following Hebrew word on the door five times in a row: The word was spelled "Shin Lamed Mem Hey." What did the message mean?As I said in the other post, this appears in R. Elijah Levita's Massoret Ha-massoret, as a quotation from a certain book called Smadar, which is quoted in various sources, but unknown to us. The context is completely different. The author of Smadar attempted to show that the Hebrew punctuation is necessary to understand it, therefore it cannot be said to have been invented much later than the writing itself. Here is what I wrote:
Masores Hamasores (third introduction) quoted the unpreserved Sefer Hasmadar by one Rabbi Levi ben Joseph which is the actual source for the observation that "שלמה" can produce the following five variations: "שֶׁלָמָה שַׁלְמָה שְׁלֹמֹה שַׂלְמָה שְׁלֵמָה."
C.D. Ginsburg's translation is:
As you can see, this quote by R. Levi ben Joseph is not a sentence at all! He merely gives 5 wods in a row, not meant to be strung into a sentence. This explains rather well why it is such an awkward sentence. ("salma shelema" - "the entire garment"? is this not strange?) As clever a mind must be to have thought of it, it is decidedly less clever to have taken R. Levi ben Joseph's five words and shaped it into a sentence.R. Levi b. Joseph, author of the book Semadar, says, at the beginning of his work, as follows: "If any one should ask, Whence do we know that the points and accents were dictated by the mouth of the Omnipotent? the reply is, It is to be found in Scriptures, for it is written, ' And thou shalt write upon the stones all the words of this law very plainly' (Deut. xxvii. 8). Now, if the points and accents, which make the words plain did not exist, how could one possibly understand plainly whether שלמה means wherefore, retribution, Solomon, garment, or perfect? " Thus far his remark. I leave it to the reader to judge whether this is reliable proof.
Be that as it may, what is the origin of this legend concerning Rashi? The proper place to look for the legend and a bibliography relating to it is in Y. Berger's article Rashi be-aggadat ha'am (Rashi in Folklore) in a volume called Rashi: Torato Ve-ishyuto (New York 1958) and he does not disappoint. On pp. 162-63 he brings the story and the sources known to him. He quotes Rabbi Y. L. Maimon's version (which I posted in the first post) , and a close parallel where the hero is Ibn Ezra, printed by Naftali ben Menachem in his collection of Ibn Ezra legends (that version concerns Rashi too - on the other side!). The earliest source he found is the following, in a book printed in Chicago in 1902. The author, Abraham Hyman Charlap (b. 1862), says it is something he heard orally from his father, Rabbi Joseph Charlap. He also says that it has never before been printed in a book - but I will show that this is mistaken:
However, I found an earlier source. The Frankfurt University Library has a copy of a Yiddish book called Sefer Ma'aseh Rashi Z"L, which it placed online (link). Unfortunately no useful bibliographical data appears on the book itself, and the catalog entry is not much more useful. However, it does state (claim) that it is from circa 1800, and from some internal evidence I suggest that this is about right. (One piece is that the book is entirely vocalized, and it seems to me that the spelling and fonts suggest that period, rather than later. In particular, I note that it vocalizes the word רבי with two chiriks, something which disappears in the 19th century.)
It quotes the usual sources one would expect, such as Shalsheles Hakabbalah and Sefer Yuchasin. It also quotes She'erit Yisrael, a popular Yiddish book by Menachem Mann Amelander, printed in Amsterdam in 1743/4. This book presents itself as Sefer Josippon Part II. It was sufficiently popular that more than a century letter Gabriel Isak Polak published an annotated Dutch translation.
Now, legend had long made Rashi into a world traveler. The Shalsheles Hakabbalah even has a whole piece about how Rashi met the Rambam in Egypt, even though he admits that some people told him that they had a tradition that Rashi lived before the Rambam. Still, he writes, his heart tells him otherwise. This sort of thing was decried by Zunz at the end of his Toldot Rashi (link; "סוף דבר הכל הבלים").
But the makers and tellers of legends never asked Zunz for permission, so legends they made and legends they passed on. The Sefer Ma'aseh Rashi brings the legend of the five words spelled the same, and it brings it gleefully:
In this version, the story occurs in Egypt, where Rashi is trying to meet the Rambam, but only the servant is at home (maybe Peter?).
As you can see, the passage begins by quoting Amelander's She'erit Yisrael and it is not clear where or if it ends. If you look up the part that deals with Rashi in Egypt to meet Maimonides, you see that this story is not mentioned.
In case there's any misunderstanding, Amelander was also published in a Hebrew translation in Vilna in 1811. You can read the identical passage here or even here, in Dutch, if you are so inclined.
Thus, we have seen the Shlomo Shlomo Shlomo &c. story not only in 1902, but even in 1800. It gives no source, and in fact the source it has just cited (about Rashi meeting the Rambam) doesn't mention it. It seems that this is indeed a Rashi legend. A genuine oral tradition. We also saw the probable source of the riddle used in the story, which is either the Sefer Smadar itself or (more likely) the Massores Hamassores of R. Elijah Levita.
Finally, it is most interesting to note that the story is such a good one, and the riddle so clever, that a variation of the legend was printed in 1911, by a great-grandson of R. Shlomo Kluger (b. 1783) - and he says it happened to his ancestor! (link)
Finally, finally, here is Ben Menachem's version where it is Ibn Ezra who tried to meet Rashi, rather than Rashi who tries to meet Maimonides: