Understanding obscure passage in Tannit 22a.
רבי ברוקא חוזאה הוה שכיח בשוקא דבי לפט, הוה שכיח אליהו גביה, אמר ליה: איכא בהאי שוקא בר עלמא דאתי? - אמר ליה: לא. אדהכי והכי חזא לההוא גברא דהוה סיים מסאני אוכמי, ולא רמי חוטא דתכלתא בגלימיה. אמר ליה: האי בר עלמא דאתי הוא. רהט בתריה, אמר ליה: מאי עובדך? - אמר ליה: זיל האידנא ותא למחר. למחר אמר ליה: מאי עובדך? - אמר ליה: זנדוקנא אנא, ואסרנא גברי לחוד ונשי לחוד, ורמינא פורייאי בין הני להני כי היכי דלא ליתו לידי איסורא. כי חזינא בת ישראל דיהבי נכרים עלה עינייהו מסרנא נפשאי ומצילנא לה. יומא חד הוות נערה מאורסה גבן דיהבו בה נכרים עינייהו, שקלי דורדייא דחמרא ושדאי לה בשיפולה, ואמרי: דיסתנא היא. אמר ליה: מאי טעמא לית לך חוטי ורמית מסאני אוכמי? - אמר ליה עיילנא ונפיקנא ביני נכרים כי היכי דלא לידעו דיהודאה אנא, כי הוו גזרי גזירתא מודענא להו לרבנן, ובעו רחמי ומבטלי לגזירתייהו. ומאי טעמא כי אמינא לך אנא מאי עובדך ואמרת לי זיל האידנא ותא למחר? - אמר ליה: בההיא שעתא גזרי גזירתא, ואמינא ברישא איזיל ואשמע להו לרבנן דלבעי רחמי עלה דמילתא.
Translation based on Soncino:
R. Beroka Hoza'ah used to frequent the market at Be Lapat where Elijah often appeared to him. Once he asked [the prophet], is there anyone in this market who has a share in the world to come? He replied: No. Meanwhile he caught sight of a man wearing black shoes and who had no thread of blue on the corners of his garment and he exclaimed: This man has a share in the world to come. He [R. Beroka] ran after him and asked him: What is your occupation? And the man replied: Go away and come back tomorrow. Next day he asked him again: What is your occupation? And he replied: I am זנדוקנא (“Rashi”: a jailer) and I keep the men and women separate and I place my bed between them so that they may not come to sin; when I see a Jewish girl upon whom the Gentiles cast their eyes I risk my life and save her. Once there was amongst us a betrothed girl upon whom the Gentiles cast their eyes. I therefore took lees of [red] wine and put them in her skirt and I told them that she was unclean. [R. Beroka further] asked the man: Why have you no fringes and why do you wear black shoes? He replied: That the Gentiles amongst whom I constantly move may not know that I am a Jew, so that when a harsh decree is made [against Jews] I inform the rabbis and they pray [to God] and the decree is annulled. He further asked him: When I asked you: What is your occupation, why did you say to me: Go away now and come back to-morrow? He answered: They had just issued a harsh decree and I said I would first go and acquaint the rabbis of it so that they will pray [to stop it].
This is one of the obscure agadot in the Talmud which is easier to understand based on the knowledge we have today. There are a lot of questions about this agada, but in the article we will only concentrate on one: the meaning of the strange term זנדוקנא that does not appear anywhere else in Hazal. In general there is a large number weird agadot in this tractate, in particular in the third Perek, and it’s possible that at least some of them were added after Hatimat Hatalmud. In particular, the main character in agada we are discussing, R. Beroka Hoza'ah, is not mentioned anywhere else in Hazal and seems to have been one of Rabanan Saburai.
It is known that at the end of the Amoraic period and later on during the period of Saburai, there were a number of shmadot and gezerot against the Jews. Part of the problem was that some of the Sasanian kings at the end of their empire were strict adherents of Zoroastrism and prosecuted people of other faiths including the Jews. R. Sherira Gaon writes the following in his famous epistle (105-106) about the end of the Talmudic period:
ומלך בתריה במתא מחסיא רב יימר ונח נפשיה בשנת תשמ"ג. ובתריה רב אידי בר אבין ושכיב בשנת תשס"ג. ובתריה רב נחמן בר רב הונא ושכיב בשנת תשס"ו. ונפל שמדא וגזר זדגרד לבטולי שבתא... ובשנת תשפ"א אתסרו כל בי כנשתא דבבל ואתנקיטו בני יהודאי לאמגוש
After him in the town of Mahasia R. Yimar ruled and he died in 743 (Seleucid era, meaning 432 CE). And after him ruled R. Idi bar Avin and he died in 763 (452 CE). After him ruled R. Nahman bar R. Huna and he died in 766 (455 CE). And Shmad started and Yazdegerd [the second] prohibited observing Shabbat… and in the year 781 (470 CE) all Babylonian synagogues became forbidden and the Jewish people were given over to magi.
The percussions that started during the reign of Yazdegerd II continued in the times of his son Peroz I. We find that the Gemora (Hulin 62b) gives a mnemonic for some non-kosher bird called peruz: וסימניך פירוז רשיעא (Peroz – the wicked) to remember that this bird is not kosher. Certainly this mnemonic was added by the Saburaim.
Coming back to our story in Taanit, Dorot Harishonim explains that זנדוקנא means the follower of Zoroastrian Scriptures. This happened during the reign of Peroz’s son Kavadh I, who gave his support to the [proto] communistic sect founded by Mazdak, who demanded that the rich should divide not only their wealth but also their wives with the poor. Now the story can be easily explained. This sect not only wanted to divide the riches, but also “divide” all the women, which besides the general barbarity obviously presented a huge Halachic problem for the Jewish people. This righteous man, pretended to become a member of this sect, in order to warn the rabbis and to save the Jewish people to the extent possible!
 “Dikduke Sofrim” brings also from various manuscripts girsaot זנדיקאand זנדקנא.
 The “Rashi” on Taanit is not Rashi but some other commentator, see Maharitz Hajes on the beginning of the masechet, see also his tshuvot in Imre Bina, 5, see also R. Saul Lieberman’s letters in “Lieberman and the Orthodox”, page 26 in the back of the book. Similarly the “Tosafot” on this masechet is of later origin (it even quotes the Tur). One of strange things in “Rashi” and “Tosafot” on this Gemora (16a) is that Har Hamoriah may be Har Sinai.
 For example, it’s strange that in the entire market there were no other people with a “share in the world to come”. One might posit that “Bar Alma Deatei” is not simply the one with a share in the world to come but someone who will merit an even greater level to be “Ben Olam Haba,” literally “A Son of Olam Haba” as Arizal (Shaar Hagilgulim, 24, and see also Tosafot, Ketubot 103b) distinguishes between simply having a share in the World to Come, being Ben Haolam Haba and being Mezuman leolam Haba (the highest level). However, R. Menashe Klein (Mishen Halachot 15:62) seems to take it literally and further projects that in New York there are even fewer people who will have a share in the World to Come.
 For example it relates (Taanis 24a) that Rabbi Yosi from Yokeret once saw how someone was staring at his daughter from afar. When questioned what he was doing the man answered that even though he knows he could never marry R. Yossi’s daughter, at least he wants to get the pleasure of watching her. Hearing this R. Yossi said that then his daughter should “go back to dust”. If taken literally this agada would be difficult to believe, did the sage actually curse his own daughter so that she dies? One of the possible approaches to this agada is that the statement “go back to dust” is meant that she should not be good looking any longer, and this way he saved both her and the men that may stumble. It is known that often times the women who are not so good looking accomplish much more in life than the ones that are. From early age they get accustomed that their accomplishments will not be judged according to their physical attraction and therefore they strive to reach spiritual heights as well as become capable in various areas. Even though our foremothers Sarah, Rivka and Rachel were praised for their physical beauty, R. Yossi may have known that his daughter is not as modest as the foremothers and for her the good looks are a disadvantage. It is also possible that his daughter was lighthearted and therefore the best thing for her was not to serve as an attraction for men
 As for instance according to Maharsha the whole story about the goats of R. Hanina ben Dosa (25a) was added later (see also Dikduke Sofrim that in fact it does not appear in many manuscripts). According to R. Shlomo Yehuda Rappaport, the explanation of the appellation Nahum Ish “Gamzu”, originally probably meant just Nahum from Gimzo (see R. Hananiel and Aruch, Gimzo, based on a town mentioned in Divre Hayamim 2:28:18). R. Nisim ben Yakov of Kairouan had a story of a miracle that happened to Nahum who used to say Gam Zu Letova and apparently it’s from there that this story got into our versions of the Gemora (see “Toldot R. Natan Baal Haaruch”, page 97, see however Zunz, “Toldot Rashi”, haara 56).
 However “Dorot Harishonim” (Vol 6, chapter 24) writes that these processions were generally not as bad as the Roman and Byzantine ones in Palestine.
 I found in “Encyclopedia Iranica” the same date for the beginning of the shmad (though the closing of synagogues is mentioned as being 3 years earlier): “In 455 CE, a Jewish persecution was initiated in the form of forbidding the Jews to celebrate the Sabbath openly and publicly, and by 467 CE Jewish schools were closed and some of the leaders were executed.”
 This was already during the reign of Peroz I.
 See the note above, see also the 24th chapter of Dorot Harishonim, vol 6. We find that at some point during this time Mata Mehasia (Sura) was destroyed. We also find a hint for this in the Talmud (Shabbat 11a) R. Ashi said: אנא עבדי למתא מחסיא דלא חרבה והא חרבה מאותו עון לא חרבה - “I made that Mata Mahasia will not get destroyed” and after this the Gemora (after R. Ashi) asks: but it was destroyed? And answers: “It was not destroyed for the sin [of having the houses higher than the synagogue].”
 Vol 6, page 62 in the name of Graetz’s “Dirvre Yeme Yisrael” vol 3, page 15 who calls them in Hebrew זינדיקיים, almost an identical word especially considering some girsaot I brought earlier in the name of “Dikduke Sofrim”.
 If he was simply a prison guard how would he know about the “harsh decrees” planned against the Jews to be able to “warn the rabbis”?
Zend-Avesta are sacred books ascribed to Zoroaster. Zendism apparently was a subset of Zoroastrism, and over time the Arabs started to call a Zendik, a person who practices heretical magic.
 According to the Wikipedia, Kavadh’s intention evidently was, by adopting the doctrine of the Mazdakites, to break the influence of powerful magnates from high classes.
 In the article I didn’t add any “hidushim” of my own; the main point is just to help those learning Masechet Taanit to understand this obscure agada. I checked that the Artscroll edition references this “Dorot Harishonim” in a footnote. Even though some Haredim would discourage learning “Dorot Harishonim” (e.g. R. Yisroel Yakov Kanievsky as brought in Orchot Rabenu) due to the author “arguing with Rishonim”, Artscroll usually does quote from these books. However since most people learning with the Artscroll will not actually check every reference brought in the footnotes, I thought it would still be useful to write this short essay, and as the history of Jewish people at the end of Sasanian rule is not too well known, I decided to add a few more sources about other shmadot that happened during that era.
 Even though a woman who is raped is permitted to her husband, if she is a wife of a kohen, she is not. Even in case of wife of a Yisrael (non-kohen), it’s not always so simple to permit his wife to return after she lived with a gentile. In addition there was a dispute regarding children of a gentile and a Jewish woman, and according to some of Hazal, their status is mamzerim, precluding them from marrying regular Jews.
 R. Chaim Dov Rabinovich in Daat Sofrim, Shoftim, says that the story of Shimshon serves as an example for a Jew spying for Israel to protect his country. He has to pretend to be an Arab, pray like and Arab, marry an Arab woman, and yet he is one of the righteous of this world. (Maybe about people like these, our sages teach (Nazir 23a) that a sin Leshem Shamaim is better than a mitzvah that is not for the Sake of Heaven!)