(5) The Book of Greetings
كتاب السلام
(134) Chapter: The Excellence of Greeting the Acquaintance Repeatedly
(134) - باب استحباب إعادة السلام على من تكرر لقاؤه على قرب بأن دخل ثم خرج ثم دخل في الحال، أو حال بينهما شجرة ونحوها
Riyad as-Salihin 860 
Abu Hurairah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "When one of you meets a brother (in Faith) he should greet him. Then if a tree or a wall or a stone intervenes between them and then he meets him again, he should greet him."

[Abu Dawud].

وعنه عن رسول الله صلى الله عليه وسلم، قال‏:‏ ‏ "‏إذا لقي أحدكم أخاه، فليسلم عليه، فإن حالت بينهما شجرة، أو جدار، أو حجر، ثم لقيه، فليسلم عليه‏"‏ ‏(‏‏(‏رواه أبو داود‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 860
In-book reference : Book 5, Hadith 17