Reference for Avodah Zarah 5:7
אֻמָּנִין שֶׁל יִשְׂרָאֵל שֶׁשָּׁלַח לָהֶם נָכְרִי חָבִית שֶׁל יֵין נֶסֶךְ בִּשְׂכָרָן, מֻתָּרִים לוֹמַר לוֹ תֵּן לָנוּ אֶת דָּמֶיהָ. וְאִם מִשֶּׁנִּכְנְסָה לִרְשׁוּתָן, אָסוּר. הַמּוֹכֵר יֵינוֹ לַנָּכְרִי, פָּסַק עַד שֶׁלֹּא מָדַד, דָּמָיו מֻתָּרִין. מָדַד עַד שֶׁלֹּא פָסַק, דָּמָיו אֲסוּרִין. נָטַל אֶת הַמַּשְׁפֵּךְ וּמָדַד לְתוֹךְ צְלוֹחִיתוֹ שֶׁל נָכְרִי, וְחָזַר וּמָדַד לְתוֹךְ צְלוֹחִיתוֹ שֶׁל יִשְׂרָאֵל, אִם יֶשׁ בּוֹ עַכֶּבֶת יַיִן, אָסוּר. הַמְעָרֶה מִכְּלִי אֶל כְּלִי, אֶת שֶׁעֵרָה מִמֶּנּוּ, מֻתָּר. וְאֶת שֶׁעֵרָה לְתוֹכוֹ, אָסוּר:
Jewish craftsmen to whom a gentile sent a jug of yayin nesech as their wage may say to him: "Give us its (worth in) money," [for they have not yet acquired it, and he owes them only money.] But if it entered their domain, it is forbidden. If one sells his wine to a gentile — If he stipulates the price [so much wine for so much money] before he measures it out (into his vessels), its monies (received in exchange) are permitted. [For meshichah (drawing to oneself the object to be acquired) effects acquisition for a gentile as it does for a Jew. So that when the Jew measures it out into his vessels and the vessel enters the domain of the gentile, he acquires it with meshichah, so that the Jew is (already) owed money by the gentile as a loan; and it does not become yayin nesech until the gentile touches (the wine itself).] But if he measures it out (into his vessels) before he stipulates the price, its monies are forbidden. [For the gentile does not acquire it now with meshichah. For since he has not yet stipulated the price, he has not committed himself to acquire it with meshichah, lest the Jew overcharge him. Therefore, when he touches it, it is yayin nesech in the domain of the Jew, the gentile not acquiring it until the price is stipulated.] If he (the Jew) took his funnel and measured out (his wine) into the vessels of the gentile, if it (the funnel) [in which he first measured out the wine for the gentile has a rim of wine, [which prevents one or two drops from leaving its mouth], it is forbidden. [The wine of the Jew is forbidden because of that drop of yayin nesech in the funnel.] If he [a Jew] pours [wine] from his vessel into a vessel [in the hand of a gentile or into a vessel containing yayin nesech], what he poured from is permitted [i.e., the wine remaining in the upper vessel in the hand of the Jew is permitted,] and what he poured into it is forbidden [i.e., the flow that left the Jew's vessel, even though it did not reach the vessel in the hand of the gentile (and, it goes without saying, what did reach the vessel of the gentile), is forbidden. [For "the flow is regarded as connected" (to the vessel beneath it.) and our Mishnah, which permits the wine left in the vessel in the hand of the Jew, speaks of an instance where the flow from the upper vessel was cut off before it reached the lower vessel in the hand of the gentile, so that there was no flow here which would connect what was in the upper vessel to what was in the lower vessel. Or, (our Mishnah speaks of an instance) where he shakes out wine from the upper vessel, as from a sprinkling bowl, so that there was no flow which would connect the wine in the vessel in the hand of the Jew to the vessel in the hand of the gentile. But if there were such a connection, then everything remaining in the upper vessel in the hand of the Jew is forbidden as yayin nesech by the principle of the flow being regarded as a connection. This is the halachah.]