We came to Jabir ibn Abdullah who was sitting in his mosque. He said: The Messenger of Allah ﷺ came to us in this mosque and he had a twig of date-palm of the kind of Ibn Tab. He looked and saw phlegm on the wall towards qiblah. He turned to it and scraped it with the twig. He then said: Who of you likes that Allah turns His face from him? He further said: When any of you stands for praying, Allah faces him. So he should not spit before him, nor on his right side. He should spit on his left side under his left foot. If he is in a hurry (i.e. forced to spit immediately), he should do with his cloth in this manner. He then placed the cloth on his mouth and rubbed it off. He then said: Bring perfume. A young man of the tribe stood and hurried to his house and returned with perfume in his palm. The Messenger of Allah ﷺ took it and put it at the end of the twig. He then stained the mark of phlegm with it. Jabir said: This is the reason you use perfume in your mosques. (Using translation from Abū Dāʾūd 485)
أَتَانَا رَسُولُ اللهِ ﷺ فِي مَسْجِدِنَا هَذَا وَفِي يَدِهِ عُرْجُونُ ابْنِ طَابٍ فَرَأَى فِي قِبْلَةِ الْمَسْجِدِ نُخَامَةً فَحَكَّهَا بِالْعُرْجُونِ ثُمَّ أَقْبَلَ عَلَيْنَا فَقَالَ أَيُّكُمْ يُحِبُّ أَنْ يُعْرِضَ اللهُ عَنْهُ؟ قَالَ فَخَشَعْنَا ثُمَّ قَالَ أَيُّكُمْ يُحِبُّ أَنْ يُعْرِضَ اللهُ عَنْهُ؟ قَالَ فَخَشَعْنَا ثُمَّ قَالَ أَيُّكُمْ يُحِبُّ أَنْ يُعْرِضَ اللهُ عَنْهُ؟ قَالَ قُلْنَا لَا أَيُّنَا يَا رَسُولَ اللهِ؟ قَالَ فَإِنَّ أَحَدَكُمْ إِذَا قَامَ يُصَلِّي فَإِنَّ اللهَ قِبَلَ وَجْهِهِ فَلَا يَبْصُقَنَّ قِبَلَ وَجْهِهِ وَلَا عَنْ يَمِينِهِ وَلْيَبْصُقْ تَحْتَ رِجْلِهِ الْيُسْرَى فَإِنْ عَجَلَتْ بِهِ بَادِرَةٌ فَلْيَقُلْ هَكَذَا بِثَوْبِهِ ثُمَّ طَوَى ثَوْبَهُ بَعْضَهُ عَلَى بَعْضٍ أَرُونِي عَبِيرًا فَقَامَ فَتًى مِنَ الْحِيِّ يَشْتَدُّ إِلَى أَهْلِهِ فَجَاءَ بِخَلُوقٍ فِي رَاحَتِهِ فَأَخَذَهُ رَسُولُ اللهِ ﷺ فَجَعَلَهُ فِي رَأْسِ الْعُرْجُونِ ثُمَّ لَطَخَ بِهِ عَلَى أَثَرِ النُّخَامَةِ قَالَ جَابِرٌ فَمِنْ هُنَاكَ جَعَلْتُمُ الْخَلُوقَ فِي مَسَاجِدِكُمْ