ENOfficial
Abu Hurayra said, "Whoever meets his brother should greet him. If a tree or wall comes between them and then he meets him, he should greet him on the other side."
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا عَبْدُ اللهِ بْنُ صَالِحٍ قَالَ: حَدَّثَنِي مُعَاوِيَةُ، عَنْ أَبِي مَرْيَمَ، عَنْ أَبِي هُرَيْرَةَ، أَنَّهُ سَمِعَهُ يَقُولُ: مَنْ لَقِيَ أَخَاهُ فَلْيُسَلِّمْ عَلَيْهِ، فَإِنْ حَالَتْ بَيْنَهُمَا شَجَرَةٌ أَوْ حَائِطٌ، ثُمَّ لَقِيَهُ فَلْيُسَلِّمْ عَلَيْهِ.
sunnah.com