I am unable to save the Email Account Settings in ERP Next 14 while configuring Office 365

I am unable to save the Email Account Settings in ERP Next 14 while configuring Office 365
While saving it says request time out.
Please help…
I am using ERP Next v14.29.2 (version-14)

Here is the screenshot of the same below

How much time it takes to pop up this erro message?

2 mins approx

check logs inside erpnext installation directory, /var/log/syslog and /var/log/nginx/error.log.

Check latest updated logs from above log files. It may give some hints about the error.

Is external/internal firewall is active?

I cant see any kind of errors.
Secondly I have disabled the firewall settings as well.

Can anybody help me with this…

@sumeet_sharma Hope you solved. The below solution help others.

I faced the same issue in frappe version 15 hosted in AWS. This error not related with Frappe. We need to enable a Out bond rules in the corresponding cloud Environment. In EC2

EC2 > Security Groups > [ Security Group Name ] 

IP version    Type       Protocol   Port range
IPv4	      Custom     TCP		  587