thinktecture-labs / cloud-native-sample

Sample application to demonstrate how to build, orchestrate, and automate a polyglot cloud-native application
MIT License
32 stars 11 forks source link

fake-smtp-server changed default ports #127

Open feO2x opened 1 year ago

feO2x commented 1 year ago

In this commit of fake-smtp-server, the default ports were changed:

We can probably just use environment variables to change to the previous port numbers.

feO2x commented 1 year ago

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables

This is how you should bind environment variable names to the corresponding configuration values. According to this, our existing SPRING_MAIL_USERNAME and SPRING_MAIL_PASSWORD environment variables do exactly nothing. They should rather be called FAKESMTP_AUTHENTICATION_USERNAME and FAKESMTP_AUTHENTICATION_PASSWORD.

feO2x commented 1 year ago

I found another issue: the Dapr SMTP binding always requires TLS (even if you set skipTLSVerify to true). There is always an exception with fake-smtp-server, either when TLS is disabled (by default)

Dapr.DaprException: Binding operation failed: the Dapr endpoint indicated a failure. See InnerException for details.
Grpc.Core.RpcException: Status(Statuscode=Internal, Detail=error invoking output binding email: error from smtp binding, sending email failed: unencrypted connection)

...or when TLS is required, a handshake error occurs:

Dapr.DaprException: Binding operation failed: the Dapr endpoint indicated a failure. See InnerException for details.
Grpc.Core.RpcException: Status(StatusCode=Internal, Detail=error invoking output binding email: error from smtp binding, sending email failed: remote error: tls: handshake failure)

I will try to switch to smtp4dev as this tool can automatically generate a self-signed certificate for local dev purposes.