Mishkat al-Masabih 1918
Abu Jurayy Jabir b. Sulaim said:
I came to Medina and saw a man whose opinion was followed by the people, for he said nothing without their acting on it. I asked who he was, and when I was told that he was God’s messenger, I said twice, “Upon you be peace, messenger of God.” 
He replied, ‘Do not say, “Upon you be peace,’ for that is the salutation to the dead, but say, ‘Peace be upon you’.” 
I asked him if he was God’s messenger, and he replied, “I am the messenger of God who, if injury befalls you and you call on Him, will remove it; if a year of famine comes upon you and you call on Him, will make things grow; if you lose your riding-beast in a barren land or desert and call upon Him, will restore it to you.” 
I asked him to give me an injunction, and he said, “Do not revile anyone.” After that I never reviled a freeman or a slave, a camel or a sheep.” He said, 
“And do not consider any act of kindness insignificant, for looking pleasantly at your brother when you speak to him is an act of kindness. Wear your lower garment halfway up to the knee, but if you dislike that, let it go down to the ankles; on no account, however, must you let it trail, for that is a kind of pride, and God does not like pride. If anyone reviles or reproaches you for something he knows about you, do not reproach him for something you know about him, for the mischief of that will lie at his door.” 

Abu Dawud transmitted it, and Tirmidhi transmitted the part about the salutation. 

A version has, “The reward of that will be yours and its mischief will be his.”
وَعَنْ أَبِي جُرَيٍّ جَابِرِ بْنِ سُلَيْمٍ قَالَ: أَتَيْتُ الْمَدِينَةَ فَرَأَيْتُ رَجُلًا يَصْدُرُ النَّاسُ عَنْ رَأْيِهِ لَا يَقُولُ شَيْئًا إِلَّا صَدَرُوا عَنْهُ قُلْتُ مَنْ هَذَا قَالُوا: هَذَا رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قُلْتُ: عَلَيْكَ السَّلَامُ يَا رَسُولَ اللَّهِ مَرَّتَيْنِ قَالَ: «لَا تقل عَلَيْك السَّلَام فَإِن عَلَيْكَ السَّلَامُ تَحِيَّةُ الْمَيِّتِ قُلِ السَّلَامُ عَلَيْكَ» قلت: أَنْت رَسُول الله؟ قَالَ: «أَنا رَسُول الله الَّذِي إِذا أَصَابَكَ ضُرٌّ فَدَعَوْتَهُ كَشَفَهُ عَنْكَ وَإِنْ أَصَابَكَ عَامُ سَنَةٍ فَدَعَوْتَهُ أَنْبَتَهَا لَكَ وَإِذَا كُنْتَ بِأَرْض قفراء أَوْ فَلَاةٍ فَضَلَّتْ رَاحِلَتُكَ فَدَعَوْتَهُ رَدَّهَا عَلَيْكَ» . قُلْتُ: اعْهَدْ إِلَيَّ. قَالَ: «لَا تَسُبَّنَّ أَحَدًا» قَالَ فَمَا سَبَبْتُ بَعْدَهُ حُرًّا وَلَا عَبْدًا وَلَا بَعِيرًا وَلَا شَاةً. قَالَ: «وَلَا تَحْقِرَنَّ شَيْئًا مِنَ الْمَعْرُوفِ وَأَنْ تُكَلِّمَ أَخَاكَ وَأَنْتَ مُنْبَسِطٌ إِلَيْهِ وَجْهُكَ إِنَّ ذَلِكَ مِنَ الْمَعْرُوفِ وَارْفَعْ إِزَاَرَكَ إِلَى نِصْفِ السَّاقِ فَإِنْ أَبَيْتَ فَإِلَى الْكَعْبَيْنِ وَإِيَّاكَ وَإِسْبَالَ الْإِزَارِ فَإِنَّهَا مِنَ الْمَخِيلَةِ وَإِنَّ اللَّهَ لَا يُحِبُّ الْمَخِيلَةَ وَإِنِ امْرُؤٌ شَتَمَكَ وَعَيَّرَكَ بِمَا يَعْلَمُ فِيكَ فَلَا تعيره بِمَا تعلم فِيهِ فَإِنَّمَا وَبَالُ ذَلِكَ عَلَيْهِ» . رَوَاهُ أَبُو دَاوُدَ وَرَوَى التِّرْمِذِيُّ مِنْهُ حَدِيثَ السَّلَامِ. وَفِي رِوَايَةٍ: «فَيَكُونَ لَكَ أَجْرُ ذَلِكَ وَوَبَالُهُ عَلَيْهِ»