Unable to configure mail app

I am unable to redirect a gmail adress towards the nextcloud mail app. I’m not sure why. Is it a probleme with gmail? with pop, imap or smtp protocols?
Could it be someting to do with iptables on my server? (I allowed the different ports -SMTP and IMAP- used by Google in iptables)
I have the same problem with my webmail hosted by OVH.

Any help will be appretiated!

You need to enable the “insecure apps” or so for that Google account. Otherwise IMAP does not work.

It works!
Thanks a lot!