Connection to external mail source doesn't work - email notifications does not work

We have an exchange on prem server in the environment. Through this server, users receive emails related to the operation of the m-files document system.

We also have established an external mail connection to this exchange server (IMAP4).

Lately we have been having these emails stop working. It looks like the exchange server is refusing all communication with the M-Files server. Only restarting both servers helps to restore the connections. Has anyone had similar problems and solved them?