Can those who are not fasting eat the food that is put out for iftar in al-Masjid al-Nabawi (the Prophet’s Mosque)?
Question

Is it permissible for one who is not fasting to eat the meals that are distributed in al-Masjid al-Nabawi for those who are fasting to break their fast?
Praise be to Allah.It is permissible for those who are not fasting to eat the food that is offered on the mats that are put out in al-Masjid al-Haram and al-Masjid al-Nabawi for those who are fasting to break their fast. That is because the custom is that those who offer this food put out those mats and do not prevent anyone from taking food, and they do not only call those who are fasting, and they are aware that many of those present are not fasting. So this is permission, according to custom, for anyone to take that food. This is something that all people are aware of, and a custom of which all people are aware comes under the same ruling as that which is stated verbally. So there is no reason why those who are not fasting should not eat these meals.
Shaykh ‘Abdullah al-Maqdisi (may Allah have mercy on him) said: When someone gives an invitation to a meal and serves the food, that is permission to eat, because of the report narrated by Abu Hurayrah from the Prophet (blessings and peace of Allah be upon him), who said: “If one of you is invited to a meal, and he comes with the messenger who was sent to invite him, that is permission [to eat].” Narrated by Ahmad and Abu Dawud. ‘Abdullah ibn Mas‘ud said: If you have been invited, then you have been given permission [to eat]. This was narrated by Imam Ahmad with his isnad…
In al-Ghunyah – by Shaykh ‘Abd al-Qadir al-Jili (may Allah be pleased with him) – it says: No permission is needed after the food is served, if the custom in that land is that the people eat when the food is served, because the custom itself is permission to eat."(Sharh Dalil al-Talib 3/313).
But if there are ready-made meals that are only intended for those who are fasting, then it is not permissible for those who are not fasting to eat them, unless permission is given by those who are distributing them, after telling them about the situation, if they are authorised to give such permission.
And Allah knows best.