All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Muslim jurists stated that it is impermissible to talk with a young non-Mahram woman so as to avoid potential Fitnah (temptation). The Hanafi scholar Al-Khaadimi wrote, “It is impermissible for a Muslim man to talk to a young non-Mahram woman for no need because it likely incurs Fitnah." The Hanbali scholar Al-Buhooti wrote, “If a man greets her (the young non-Mahram woman), she should not greet him back so as to eliminate potential evil.” [Kash-shaaf Al-Qinaa’]
The Shaafi‘i jurists stated that it is impermissible for a young non-Mahram woman to greet the non-Mahram man or return his greeting; and they held it disliked for a man to greet a non-Mahram young woman. They explained the difference in the ruling of the two cases (impermissibility that she greets him first, and dislikeability that he greets her first) that when the woman greets him first or returns his greeting, this encourages him to covet her.
Hence, it is more prudent to abstain from communicating with your teacher so as to be on the safe side and in order to eliminate potential Fitnah; and supplicate Allaah for her.
For more benefit, kindly refer to Fatwa 90066.
Allaah Knows best.