Keycloak Test Email fails with Error " Failed to Send Email "

Hi Team ,

We have Installed & Configured Keycloak on different kubernetes environments for our use case. We configured AWS SES for smtp configurations. The Email option is working on one kubernetes cluster but not other .We are using same smtp credentials for both Keycloak.
Below is the keycloak logs :
org.keycloak.email.EmailException: com.sun.mail.util.MailConnectException: Couldn’t connect to host, port: email-smtp.xx-xxx-1.amazonaws.com, 587; timeout 10000;

image

1 Like

Try only StartTLS and not Enable SSL

Actually, your config looks like you’ve set port 465, and your log shows 587.

If it’s a timeout, you should also check network connectivity between your server and that host/port.

Hi @xgp

Thank you for the reply , Tried without SSL also same error

So what happened, did it fix ?

Very interested if this was resolved?

This is most likely a network configuration issue. If anyone else is having the same, verify:

  • If you have network policies in your k8s namespaces, verify if they are allowing egress to SES as well
  • If you are using a service mesh, make sure you allow egress through that port and the correct endpoint
  • If your security group for the cluster nodes is allowing egress through your SMTP port
  • If your subnet if not blocking the connection through outbound ACL rules
  • If you are using a VPC endpoint/interface that you are allowing traffic to go through the right endpoint and port as well

With those in mind, you should be able to communicate with SES without any trouble.

Was it resolved? I am also facing the similar issue. When using some port, it is showing couldn’t connect to host and when using some other port it is showing 503 Authentication required (I am trying to use role-based permission without username and password)