I am struggling to get courier to speak to a simpl...
# ory-selfhosting
s
I am struggling to get courier to speak to a simple, development SMTP server with no authentication, and no TLS (and of course no x509 cert). This is only for dev, not for production, but still, it should work... My kratos.yml contains: courier: smtp: connection_uri: connection_uri: smtp://smtp.xxx.yyy:25/?disable_starttls=true?skip_ssl_verify=true which results in log entries like this: time=2023-11-29T152123Z level=error msg=Unable to send email using SMTP connection. func=github.com/ory/kratos/courier.(*courier).dispatchEmail file=/project/courier/smtp.go:215 audience=application error=map[messagetls failed to verify certificate: x509: certificate signed by unknown authority stack_trace:stack trace could not be recovered from error type *tls.CertificateVerificationError] message_from=no-reply@ory.kratos.sh message_id=c1e5c47d-b079-4b2b-8eee-58e20e263bb8 message_nid=b97b5f72-0490-4ed9-8046-c32dc4e57216 service_name=Ory Kratos service_version=v1.0.0 smtp_server=smtp.xxx.yyy:25 smtp_ssl_enabled=false To me this looks like it is trying to do an x509 certificate validation even though startTLS and ssl_verify are disabled (excuse the negative logic) anyone seen anything like this?
n
I have the same problem, and switching to HTTP delivery doesn’t work either. What I have found is that the thread that is pulling emails from the queue to send is never running. I just asked about this in the Kratos channel.
I think I found the answer. Some instance of Kratos must be started with the —watch-courier flag, or the thread they sends emails will never run. The way to do this seems to be to start a separate process as opposed to setting the flag on
Kratos serve
s
Aha, many thanks. I will try that.
n
Worked for me and didn't need a second instance. Just add the flag to the end...