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 & 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 & stink with the stench of carrion, there's no way that flies won't swarm & 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 & stink with the stench of carrion, there's no way that flies won't swarm & attack.