Ibn Asim al-Ashari al-Makhzumi reported that the Messenger of Allah ﷺ said, "Fasting while traveling is not an act of righteousness."
بن عاصم الأشعري المخزومي، قال: قال رسول الله ﷺ: ليس من البر الصيام في السفر.
Nasai (2255), Ibn Majah (1664), Imam Ahmad (23679, 23680, 23681), Ibn Khuzayma (2016), Hakim (1/433), Abdul-Razzaq (4467), and Tahawi (3137) all narrated it through Zuhri, from Safwan bin Abdullah, from Umm Darda, from Kaab bin Aasim, who related it.In some sources it appears as, "laysa min am-birri am-siyamu fi am-safar" (using "am" in place of the definite article "al").Ibn Hajar said in Talkhis (2/205), "This is a dialect used by some of the people of Yemen, who turn the definite article's lam into a mim. It is possible that the Prophet ﷺ addressed this Ashari man in that dialect, since it was his native speech. It is also possible that this Ashari man spoke the words according to what he was accustomed to in his own dialect, and the narrator picked it up from him and transmitted it in the very wording he heard. This second possibility seems stronger to me."Hakim said, "sahih in terms of its isnad, though the two of them [Bukhari and Muslim] did not include it."