hi friends, I'm having some trouble sending email ...
# ory-network
t
hi friends, I'm having some trouble sending email via SMTP. I've just changed the config to use Postmark to send emails. took me a couple of tries to work out the correct settings, but I finally got it working (see proof of email being sent). I tested account recovery and two emails were sent successfully (see screenshot proof). I meddled with the config some more and now it completely stopped sending any emails. I am 99.9% sure that I've got the config right (changed it back to what it was when emails were sent), but now Ory refuses to send any emails. is there a way to see logs? I'm really struggling to understand what's going on here 🤔
here's my config with redacted credentials
I also get this error when I try to change unrelated settings via the UI:
Setting the SMTP Courier from address is only possible when supplying a custom SMTP Courier SMTP URL. To resolve this, visit: https://www.ory.sh/dr/1. Please check that the urls are in the correct format and try again.
h
that’s strange 🤔 is the output above from
ory get project ... --format json
?
t
yep
I've also tried changing the scheme to
smtp
, adding port, disabling ssl validation
smtps://$token:$<mailto:token@smtp.postmarkapp.com|token@smtp.postmarkapp.com>:587?skip_ssl_verify=true
in pretty much all combinations
so I suspect this might be a server issue but I'm not sure how
h
the error message is really strange
what’s your project ID?
t
08cf0e35-1da3-4a99-bdab-1eea75d935ca
h
Copy code
"audience":"application","error":{"message":"tls: first record does not look like a TLS handshake","stack_trace":"stack trace could not be recovered from error type tls.RecordHeaderError"},"file":"/go/pkg/mod/github.com/ory/kratos@v0.9.0-alpha.3.0.20220526150455-617949cb87e9/courier/smtp.go:201","func":"<http://github.com/ory/kratos/courier.(*courier).dispatchEmail|github.com/ory/kratos/courier.(*courier).dispatchEmail>","level":"error","message_from":"<mailto:team@zezam.io|team@zezam.io>","msg":"Unable to send email using SMTP connection.","service_name":"Ory Kratos","service_version":"master","smtp_server":"<http://smtp.postmarkapp.com:587|smtp.postmarkapp.com:587>","smtp_ssl_enabled":true,"time":"2022-07-07T09:47:15Z"}
t
🤔
h
try
Copy code
<smtp://user:pass@smtp.postmarkapp.com:587>
t
yeah just changed it to that and it works
I.... swear I had that
but evidently I didn't
thanks! sorry to trouble you with this
is there any way for me to access those logs?
perhaps you could surface the errors somewhere
h
not yet, we’re really bad with error visibility right now 😞 we have to address this though. @fast-lunch-54279 @famous-art-85498 we need some way to take log out put, associate it with a tenant, and then have a view of all relevant logs in the UI
👍 1
t
ok wait
it's broken again
😂
ok phew I'm happy that it broke because I was so certain that I had it set to smtp at one point
so I changed the uri to
smtp://$token:$<mailto:token@smtp.postmarkapp.com|token@smtp.postmarkapp.com>:587
, when I applied that I got all emails that failed in the earlier tries
now it stopped sending emails again
I wonder if it's a postmark issue actually
h
check the spam folder maybe
i can see that your emails are being delivered
t
I can see incoming emails in postmark before they land in spam
ok, looks like they are delivered but with a couple minutes delay. perhaps that threw me off when testing different options. anyway, looks like that's working now 👍
I still get this error though when trying to change settings in the UI:
Setting the SMTP Courier from address is only possible when supplying a custom SMTP Courier SMTP URL. To resolve this, visit: https://www.ory.sh/dr/1. Please check that the urls are in the correct format and try again.
given that the url is definitely valid now that seems to be an actual bug
h
yes it looks like the UI might be missing the courier URL. we’ll look into it!
t
great. thanks for your help!
h
my pleasure, sorry for the wonky experience
t
the bleeding edge is what keeps life exciting 😂
h
lmao, with an emphasis on bleeding 😄 😄
🤣 1