TLS/SSL Certificate retrieved from wrong port

When is try to use automatic configuration to create a new account I get a message that the certificate of my mail server is not good. However the server name it uses to verify the certificate is the server name for the primary domain (jdvl.nl) instead of the server name used in the MX record (mail.jdvl.nl) in the DNS for my domain. That is a bug. it should use the server named in the mx record and not go to my primary domain as my mail server.

Screenshot_2

I did some more digging and testing and found what is the problem. EM client is first checking my primary domain and after that my mail domain. My primary domain had a wrong certificate since I never use that and only use subdomains.
After I set the proper certificate on my primary domain it checked the mail server domain and also got a certificate error. This time on the mail server name in the MX record:

When I check the mail domain on my default http port 80 I get a certificate error:

However when I check the mail domain on my TLS/SSL ports then it comes out right:

So em client is checking the SSL/TLS certificate for the mail server in the MX record on the wrong port.