gessnerfl / fake-smtp-server

A simple SMTP Server for Testing purposes. Emails are stored in an in-memory database and rendered in a Web UI
Apache License 2.0
408 stars 83 forks source link

Allow Emails sent with TLSv1.2 #489

Closed chinzzz closed 1 week ago

chinzzz commented 1 month ago

Is there a configuration I need to change to allow emails sent with TLSv1.2? Currently, emails with TLSv1.2 are not reflecting/reaching our server. Looks like the server is not accepting email with TLS. I am using fake-smtp-server version 2.1.4.

gessnerfl commented 1 month ago

@chinzzz to be honest, I haven't tested the TLS support myself yet. It was implemented on top of the original SMTP implementation. However, I have investigated the issue a bit and suspect that your problem is the server certificate used. Since no special handling is implemented, the default Java keystore and truststore are used. If you think this might be your problem, I could add the option to configure keystore and truststore for the mail socket so you can configure your TLS certificates accordingly.

chinzzz commented 4 weeks ago

@gessnerfl, apologies for the late response. We are still doing some investigations but so far the paths are leading to the server certificate. That configuration you mentioned will be very helpful and might actually fix the issue.

gessnerfl commented 1 week ago

@chinzzz I added an improved support for TLS with version 2.3.0. You can now configure the keystore used for TLS. When providing keystore, TLS is enabled and can be configured to be mandatory.

See also https://github.com/gessnerfl/fake-smtp-server?tab=readme-ov-file#tls