OpenHABianPi unable to edit mail.cfg

I’m trying to enter some settings in the mail.cfg file. Through the samba share it keeps telling me the file is in use.

Is there any other way to edit the file?

I found this command which apparently shuts down OH2 but I still cannot edit the file.
sudo systemctl stop openhab2.service

sudo nano /etc/openhab2/services/mail.cfg

Thanks @Oli, I wasn’t quite sure on the path I’d need to use… That seems to have worked.