Hi,
I uninstalled all perl libraries, including the ones which I had compiled and installed through RPM, and reinstalled them manually.
With this imapsync script stopped exiting, but used to just freeze on login stage, as if waiting for Gmail to respond.
Then I upgraded to IO-Socket-SSL-1.31 and Net-SSLeay-1.35 and now it works
Because the same command was working for you, I thought of reinstalling the libraries.
Thanks and regards,
Gurdeep