Mu'awiyah bin Qurrah narrates from his father (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Whoever eats of these two plants, let him not come near our mosque; if you must eat them, then kill their smell by cooking them."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5066