Unless you’re somehow having Caddy proxy your outgoing email, I don’t think it’s related.
You don’t have to make it socketed, you can just refer to the docker name and/or IP. Discourse working with jwilder /nginx proxy & acme-companion - #7 by Steve_Emerson talks about using the socketed template and a bunch of other stuff.