عن عبيد الله بن عدي بن خيار أنه دخل على عثمان بن عفان رضي الله عنه وهو محصور فقال إنك إمام عامّةٍ ونزل بك ما ترى ويصلي لنا إمام فتنةٍ ونتحرج فقال الصلاة أحسن ما يعمل الناس فإذا أحسنَ الناس فأحسِن معهم وإذا أساءُوا فاجتنب إِساءتهم وقال الزبيدي قال الزهري لا نرى أن يصلَّى خلف المخنَّث إلا من ضرورة ل ا بد منها
صحيح البخاري كتاب الأذان
‘Ubaid Allah ibn ‘Adi ibn Khiyar related that he went in to see ‘Uthman ibn ‘Affan (may Allah be pleased with him) when he was being beseiged, and said: Indeed you are a leader [imam] of the people, and what you see has come upon you; we are being led in prayer by an imam of enticement, and we are in an uncomfortable situation. And he said: Prayer is the best thing that people can do, so whenever people do good, do good with them, and when they do wrong, stay away from their wrongdoing. Al-Zubaidi said that Al-Zuhri said: In our opinion one should not pray behind an effeminate man, except out of necessity if there is no other way.
Sahih Al-Bukhari, The book of call to prayer [adhan]