Yahya bin Jurayj said: I asked Ata (may Allah have mercy on him), "Will the legal punishment (hadd) be imposed if the smell of wine is detected?" Ata (may Allah have mercy on him) replied: "The smell comes from that wine in which there is harm (intoxication). So, if many people drink the same kind of wine and only one of them becomes intoxicated, then the full punishment of lashes will be imposed on all of them." Imam Shafi'i (may Allah have mercy on him) said: Ata's statement is exactly like the statement of Umar (may Allah be pleased with them both).
Hadith Referenceمسند الإمام الشافعي / كتاب الحدود / 1567
Hadith Takhrijصحیح شواهده اخرجه البیهقی : 313/8 - وفى المعرفة السنن والآثار له (5218)۔