Sayyiduna Abu Umamah (may Allah be pleased with him) transmits this saying of the Prophet (peace and blessings be upon him): "Doing good is fitting only toward a person of noble lineage, or of religion, or one who is forbearing."
Al-Tabarani recorded it; its chain contains a narrator, Sulayman bin Salamah al-Khaba'iri, who is matruk (abandoned).