I have heard that on one occasion the Blessed One was staying at Varanasi in the Game Refuge at Isipatana. Then early in the morning the Blessed One, having put on his robes and carrying his bowl and outer robe, went into Varanasi for alms. As he was walking for alms near the fig-tree at the cattle yoke, he saw a certain monk whose delight was in what is empty, whose delight was in exterior things, his mindfulness muddled, his alertness lacking, his concentration lacking, his mind gone astray, his faculties uncontrolled. On seeing him, the Blessed One said to him: "Monk, monk, don't let yourself putrefy! On one who lets himself putrefy and stink with the stench of carrion, there's no way that flies won't swarm and attack!"
Then the monk -- admonished with this, the Blessed One's admonishment -- came to his senses.
So the Blessed One, having gone for alms in Varanasi, after the meal, returning from his alms round, addressed the monks [and told them what had happened].
When this was said, a certain monk said to the Blessed One, "What, lord, is putrefaction? What is the stench of carrion? What are flies?"
"Greed, monk, is putrefaction. Ill will is the stench of carrion. Evil, unskillful thoughts are flies. On one who lets himself putrefy and stink with the stench of carrion, there's no way that flies won't swarm and attack.
"On one whose eyes and ears
are unguarded,
whose senses
are unrestrained,
flies swarm:
resolves dependent on passion.
The monk who is putrid,
who stinks of the stench of carrion,
is far from Unbinding.
His share is vexation.
Whether he stays
in village or wilderness,
having gained for himself no
tranquility,
he’s surrounded by flies.
But those who are consummate
in virtue,
who delight
in discernment and calm,
pacified, they sleep in ease.
No flies settle on them."