This poem is attributed Imām Shāfiýī:

idha’l mar’u lā yaráāka illā takallufā
fa daá’hu w lā tukthir álayhi ta’assufā
fa fi’n nāsi abdālun wa fi’t tarki rāĥatun
wa fi’l qalbi şabrun li’l ĥabībi wa law jafā
fa mā kullu man tahwāhu yahwāka qalbuhū
wa lā kullu man şāfaytahu laka qad şafā

idhā lam yakun şafwu’l widādi ťabīátan
fa lā khayra fī wuddin tajī’u takallufā
wa lā khayra fī khillin yakhūnu khalīluhu
wa yalqāhu min baádi’l mawaddati bi’l jafā
wa yunkiru áyshan qad taqādama áhduhu
wa yuž’hiru sirran kāna bi’l amsi qad khafā

salāmun ála’d dunyā idhā lam yakun bihā
şadīqun şadūqun şādiqu’l waádi munşifā

Dīwān ash-Shāfiýī p.285; Jawāhiru’l Adab p.719