Imam al-Shafi'i (may Allah have mercy on him) said: "Poetry is (also) speech: its good part is like good speech and its bad part is like bad speech, except that it is speech which endures and spreads (among people), and that is its distinction (and excellence) over ordinary speech. So whoever among the poets is not known for disparaging the Muslims, harming them and doing so excessively, nor (known) for lying a great deal when he praises someone, his testimony will not be rejected."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q21098