Ohalos18: 7
הַקּוֹנֶה שָׂדֶה בְסוּרְיָא סְמוּכָה לְאֶרֶץ יִשְׂרָאֵל: אִם יָכוֹל לְהִכָּנֵס לָהּ בְּטָהֳרָה — טְהוֹרָה, וְחַיֶּבֶת בְּמַעַשְׂרוֹת וּבִשְׁבִיעִית. וְאִם אֵינוֹ יָכוֹל לְהִכָּנֵס לָהּ בְּטָהֳרָה — טְמֵאָה, וְחַיֶּבֶת בְּמַעַשְׂרוֹת וּבִשְׁבִיעִית. מְדוֹרוֹת הָעוֹבְדֵי כּוֹכָבִים, טְמֵאִים. כַּמָּה יִשְׁהֶא בְתוֹכָן וִיהֵא צָרִיךְ בְּדִיקָה? אַרְבָּעִים יוֹם. אַף עַל פִּי שֶׁאֵין עִמּוֹ אִשָּׁה. וְאִם הָיָה עֶבֶד אוֹ אִשָּׁה מְשַׁמְּרִים אוֹתוֹ — אֵינוֹ צָרִיךְ בְּדִיקָה.
Someone who purchases a field in Syria near the Land of Israel — if [the field] can be entered while remaining tahor, it is tahor and it is obligated in maasros and sheviis. If he cannot enter the field while remaining tahor, the field is tamei and it is obligated in maasros and sheviis. The dwellings of idolaters are tamei. How long must he have remained (in the dwelling) to require a search? Forty days. [The dwelling is tamei] even if there is no woman with him. If there is a slave or a woman watching over him, a search is not required.