The Messenger of Allah ﷺ led us in the dawn prayer at Hudaybiyah following a rainfall that had occurred during the night. When he finished, he turned to face the people and asked, "Do you know what your Lord has said?"They replied, "Allah and His Messenger know best."He said, "He has said, 'This morning some of My servants believe in Me and others disbelieve in Me. Whoever said, "We have been given rain by the grace and mercy of Allah," he is a believer in Me and a disbeliever in the stars. But whoever said, "We have been given rain by such and such a star," he is a disbeliever in Me and a believer in the stars.'"
صلي لنا رسول الله ﷺ صلاة الصبح بالحديبية على إثر سماء كانت من الليل، فلما انصرف أقبل على الناس، فقال: أتدرون ماذا قال ربكم؟ قالوا: الله ورسوله أعلم. قال: قال: أصبح من عبادي مؤمن بي وكافر بي، فأما من قال: مطرنا بفضل الله ورحمته فذلك مؤمن بي كافر بالكوكب، وأما من قال: مطرنا بنوء كذا وكذا فذلك كافر بي مؤمن بالكوكب.
Malik narrated it in "Seeking Rain" (4), from Salih bin Kaysan, from Ubaydullah bin Abdullah bin Utba bin Masud, from Zayd bin Khalid, and he related it.Bukhari narrated it in "The Adhan" (846), from Abdullah bin Maslama, and Muslim in "Faith" (71), from Yahya bin Yahya, both of them from Malik, with the same account.