Does swallowing one’s saliva break the fast if it has been changed by the colour or smell of food?
Question

I read a fatwa of Shafa‘i jurisprudence which said that swallowing saliva, if it has changed as a result of food but the food itself is gone from the mouth, is permissible, because it is difficult to avoid it. My question is: is it permissible to swallow saliva after sahoor if it has changed because of food, but the food itself has disappeared, with the intention of moistening the throat and finding pleasure in that? Please note that it does not invalidate the fast according to the fatwa I read, and it is overlooked. I hope that you can answer my question, because I am worried about my fast and am anxious about my intention, and I do not want to break my fast at all, and if I were to be offered food during the day in Ramadan I would never eat it. If it is not permissible, then do I have to make up the days on which I did that? Please note that I did not know this particular ruling at that time.
Praise be to Allah.The well-known view in the madhhab of Imam ash-Shafa‘i is that a distinction is made between swallowing saliva of which the taste or smell has changed, which does not break the fast, and saliva of which the colour has changed because of food, which does break the fast.
The reason for this differentiation is that the change in the taste or smell of saliva may occur because of coming into contact with food, not because of being mixed with it, in contrast to the change in colour [which does break the fast].
An-Nawawi (may Allah have mercy on him) said in al-Majmu‘ (6/354):
If the taste or smell comes into the person’s stomach without any substance of the food with it, then it does not break the fast, because this taste is the result of having been in contact with the saliva. This is our view. End quote.
He also said:
Swallowing saliva does not break the fast according to scholarly consensus, if it is in its normal state, because it is difficult to avoid it.
Our companions said: it only does not break the fast if it meets the conditions, the first of which is that it is purely saliva; if something else is mixed with it that changes its colour, then the fast is broken by swallowing it, regardless of whether what changes it is pure, such as one who wets a piece of dyed thread [to thread a needle with it], then it changes his saliva, or it is impure, as in the case of one whose gums bleed or whose tooth is pulled out, or his mouth becomes impure for some other reason. That does break the fast, and there is no difference of scholarly opinion regarding that, because what is overlooked is saliva itself, which cannot be avoided, but this is different to saliva, and he is being negligent [if he swallows it] …"(Al-Majmu‘  6/317).
Some of the Shafa‘is are of the view that swallowing saliva of which the colour has been changed by food or anything else does not break the fast either.
In I‘aanat at-Talibin (2/267), it says that the trace that remains after drinking coffee, which could change the colour or taste of the saliva, affects the fast if it is swallowed. Then he stated that perhaps it does not affect it, and he explained that by saying that the mere change of colour that occurs in the saliva could be as a result of coming into contact with the black colour of the coffee, for example.
Then he said: What may be concluded from [the scholars’] words is that if you know that there is something in the saliva that has a substance, then it affects the prayer and the fast, otherwise it does not, even if its colour or smell changes, whether that is because of saliva having come into contact with the dye or some spices, so take note of that. End quote.
In Sharh al-Muqaddimah al-Hadramiyyah by ad-Daw‘ani (552), it says, explaining the guidelines on saliva that does not break the fast if swallowed:
Conclusion: with regard to saliva that is mixed with something that causes a change in its colour, taste or smell, if the thing that mixed with it has a substance, then it affects the fast or prayer. In contrast, if the change in the saliva resulted from having merely come into contact with something, in that case it does not affect anything. End quote.
Undoubtedly it is always most prudent approach to avoid swallowing saliva if its colour has changed, because the presence of colour may strongly indicate that the substance of the food is still present.
So if someone eats something that has colour which will affect the colour of his saliva, or some of its colour will be left on his tongue, then he should try to deal with it by washing his mouth with a toothbrush and toothpaste, in order to remove the traces of the colour from his mouth, and so as to put an end to any intrusive thoughts (waswas) about the validity of his worship.
If he tried his best [to remove the colour] and there is still something left that he was not able to remove, then there is no blame on him.
Shaykh Sulayman al-Jamal (may Allah have mercy on him) said: If some food is left between his teeth, and his saliva mixed with it without him intending that, it does not break the fast, if he did not detect it and spit it out, because he is excused.
That is in contrast to the case if he was able to detect it and spit it out, and it reached his stomach; in that case it does invalidate the fast, because he has fabeen negligent.
But does he have to clean between his teeth [with a toothpick and the like, such as brushing the teeth] at night, if he knows that there is something left between his teeth that his saliva may pick up during the day and he may not be able to detect it and spit it out?
The more correct view, as is clear from [the scholars’] words, is that he does not have to do that.
To explain further, the reason why he is not required to do that is that he is required to detect it and spit it out when he is able to do that whilst he is fasting, so he does not have to do that before fasting, but it is more appropriate for him to check on that at night."(Hashiyat al-Jamal ‘ala Sharh al-Manhaj  2/319).
So with regard to one who was faced with this problem in the past, and did not take precautions against it, and did not know what he should have done regarding that, what appears to be the case is that he does not have to do anything, and that the fasts he observed in the past are valid, and he does not have to repeat any of them.
Shaykh ‘Abd al-‘Aziz ibn Baz (may Allah have mercy on him) was asked:
Whilst I was doing Fajr prayer in Ramadan, I could not help but swallow my saliva, and I noticed the taste of blood from my gums, as a result of using the siwak or toothpick to remove food. Does this affect my fast or not?
He replied: As for saliva, there is nothing wrong with swallowing it; there is nothing wrong with a person swallowing his saliva in the case of normal saliva. As for sputum from the chest or head, it should not be swallowed once it reaches the mouth; what is required is to eject it and spit it out, not swallow it. Deliberately swallowing it invalidates the fast, according to the correct view, and that day must be made up.
But if there is something else in his saliva, such as pieces of food that are stuck between the teeth, such as meat or bread or fruit, or there is any blood as a result of using the siwak, then the matter is subject to further discussion:
If he is aware of that, he should not swallow it deliberately; rather he should spit it out. If he is not aware of that, and he swallows his saliva as usual, then he realises what happened, it does not matter, because he did not do it deliberately. This is like one who rinses his mouth and nose, and something reaches his throat without him intending it to, or one who coughs or vomits without intending to. This does not affect his fast; rather what affects the fast is deliberately swallowing sputum or blood that reached his mouth, or deliberately swallowing food in his mouth. This is what affects the fast. But if he did not do that deliberately – rather he could not help it, and he did not do it deliberately – this does not affect his fast."(shaykh’s website).
And Allah knows best.