ספר המדות Improper Thoughts / Part I · לז
Sefer HaMiddot 768
לז. מִי שְׁתְּפִלָּתוֹ אֵינָהּ אֶלָּא בִּשְׁבִיל הַשְּׁכִינָה, לא יָבוֹא לוֹ מַחֲשָׁבוֹת זָרוֹת.
37. Someone whose prayer is only for the sake of the Divine Presence, will not have foreign thoughts come to him.