COMING OUT PEACEFULLY (Yerushalmi Terumos Perek 2 Halachah 1 Daf 10b)
תמן תנינן התורם את הבור ואמר הרי זו תרומה על מנת שתעלה בשלום שלום מן השבר שלום מן השפיכה אבל לא מן הטומאה ר''ש אמר אף מן הטומאה
(Mishnah in Maseches Tevul Yom): One who separated Terumah from (wine in) the pit and said, "This is Terumah on condition that it comes out in peace''. (It is unclear as to his intention). We say that he meant (peacefully) without the barrel breaking or from being spilled. (But if it became Tamei before it comes up, it is still valid Terumah.) R. Shimon said that his intention was also on Tumah (so if it becomes Tamei before it comes up, it returns to its state of Tevel).
אמר רבי יוסי בן חנינא בטומאת טבולי יום היא מתניתא
(R. Yosi ben Chanina): The Tumah that he meant was Tumas Tevul Yom (that it should not be Terumah if it will become Tamei through Tevul Yom, but not other Tumahs).
אמר רבי אילא שכן טבולי יום מצויין בין הגיתות
(R. Ila): That's because people who are Tevul Yom are often to be found making wine.
אמר רבי יוסי אין לטבול יום מגע אצל טבל
(R. Yosi): (Why is that? Because) a Tevul Yom cannot make Tevel Tamei (as he can only make something a Shelishi L'Tumah, which is only relevant to Terumah).
תני אמר רבי יודן בד''א בתרומה גדולה שהיא צריכה לתרום מן המוקף אבל בתרומת מעשר אפילו שאר כל הדברים שלום הן
Baraisa (R. Yudan): This applies to Terumah Gedolah that must be separated from produce in close proximity (i.e. before it leaves the pit), but concerning Terumas Maaser, which doesn't require this, even if they come out a little broken or spilled, it's considered to have come out peacefully.
היה תורם תרומה ותרומת מעשר כאחת אינה שלום
If he was separating Terumah and Terumas Maaser at the same time and gave the condition that it's Terumah if it comes out in peace, if it broke or was spilled, it is not considered 'peaceful' and it is not valid Terumah or Terumas Maaser.
יהודה ברבי אומר לא עלתה על דעתו של זה לעבור על דברי תורה [דף כ עמוד א (עוז והדר)] להקדים תרומת מעשר לתרומה גדולה
(Yehuda b'Rebbi): This person wouldn't wish to transgress by separating Terumas Maaser before Terumah Gedolah.
מתיב ר' אבא בר ממל והא תנינן אין תורמין מן הטמא על הטהור הגע עצמך שתרם ואמר לא עלתה על דעתו לעבור על דברי תורה
Question (R. Abba bar Mamal): The Mishnah taught earlier (Chulin 63(e)) that one may not separate from Tamei for Tahor, but if he did - if it was Shogeg (inadvertent), it is valid; if it was Mezid (intentional), it is invalid. If so, when the person separated, since he hadn't intended to give from the Tamei, why doesn't that invalidate the Terumah...?
א''ר בא בר [דף יא עמוד א] ממל אם אמר את כן נמצאת מבריחו מן הקלה ומכניסו לחמורה טבל בעון מיתה (טמא שאכל את הטהור)[טהור שאכל את הטמא אינו אלא] בעשה.
Answer (R. Ba bar Mamal): If you would say that, you would cause him to stumble and eat Tevel which is punishable by death from Heaven. Without that, he would have 'merely' transgressed the positive Mitzvah of a Tahor person eating Tamei Terumah.
תני בשם רבי יוסי אם תרם מן הטמא על הטהור בין בשוגג בין במזיד מה שעשה עשוי.
Baraisa (from R. Yosi): If a person separated from Tamei for Tahor, whether inadvertently or intentionally, it is valid.
ר' פינחס בעא קומי ר' יסא כדון כסבור בהו שהן טהורין היה יודע שהן טמאין וסבור שמותר לתרום מן הטמא על הטהור
Question (R. Pinchas to R. Yasa): When we said that if he separated it inadvertently it is valid; his mistake was in thinking that the produce was Tahor. But would the law be the same if he knew it was Tamei but he had thought that it was still permitted?
אמר ליה יאות רבי סבר כרבי יודא ברם כר' יוסי היא הדא היא הדא.
Answer (R. Yasa): Rebbi had brought the opinion of R. Yehuda in the Mishnah (that if he did it intentionally, it is not valid); but I follow the view of R. Yosi that even if it was intentional, it is valid, so it certainly shouldn't make any difference as to what was his mistake.