In the debug output, it shows communications with the server, and SMTP only uses one socket connection, so I dont think that”s it.
But, having it work outside docker but not inside seems to be the biggest hint. Maybe there are perl modules needed for the auth that didn’t get included in the docker image? Could also be missing SSL certificates or something. A quick way to check would be to run it under strace and see if it tries to open a file right before saying it cant authenticate. (but running strace inside docker requires the --priveleged flag)