SHAFAQNA – The Grand Ayatollah makarem Shirazi answered a question about friendship with non-Mahram whilst fasting.
Question: What is the ruling about friendship with non-Mahram whilst fasting?
The Grand Ayatollah Makarem: Firstly, friendship with non-Mahram is Haram, and must repent immediately, and cut this relation. Secondly, if talking with non-Mahram is more than the usual talks and causes mischief, it is Haram. In both cases, although fasting does not become void (Batel), but it is considered as committing a sin and the rewards for their fasting is reduced.
Source: PERSIAN SHAFAQNA