ripe-alarm-21163
03/26/2022, 7:27 PMkratos to 0.9, sending emails doesn't work on local mail server (mailhog or mailslurper) in docker.
Is anyone having similar problem? it worked in 0.8 for me. logs say that it sent the mail but i don't receive anything.
docker-compose:
# --------------------------------------------------------------------------------
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025"
- "1025:1025"
networks:
- intranet
# --------------------------------------------------------------------------------
mailslurper:
image: oryd/mailslurper:smtps-latest
ports:
- "4436:4436"
- "4437:4437"
- "1025:1025"
networks:
- intranet
# --------------------------------------------------------------------------------
i tried many things for `connection_uri`:
smtp://mailhog:1025?disable_starttls=true&skip_ssl_verify=true
smtp://test:test@mailhog:1025?disable_starttls=true
smtp://mailslurper:1025?disable_starttls=true&skip_ssl_verify=true
smtp://test:test@mailslurper:1025?disable_starttls=truefaint-energy-48611
03/28/2022, 10:15 AMhigh-optician-2097
high-optician-2097
smtps://test:test@localhost:1025/?skip_ssl_verify=true
this we use in the e2e tests together with:
docker run --name mailslurper -p 4436:4436 -p 4437:4437 -p 1025:1025 oryd/mailslurper:latest-smtpsfaint-energy-48611
03/29/2022, 9:20 AMSending out verification email with verification link , but the courier just doesn't pick it up ๐คfaint-energy-48611
03/29/2022, 9:26 AMhigh-optician-2097
faint-energy-48611
03/29/2022, 9:50 AMkratos_courier_1 | time=2022-03-29T09:48:32Z level=info msg=Courier worker started. audience=application service_name=Ory Kratos service_version=v0.9.0-alpha.3
kratos_courier_1 | time=2022-03-29T09:48:32Z level=error msg=Unable to send email using SMTP connection. audience=application error=map[message:dial tcp 127.0.0.1:1025: connect: connection refused stack_trace:
kratos_courier_1 | github.com/ory/mail/v3.(*Dialer).Dial
kratos_courier_1 | /go/pkg/mod/github.com/ory/mail/[email protected]/smtp.go:92
kratos_courier_1 | github.com/ory/mail/v3.(*Dialer).DialAndSend
kratos_courier_1 | /go/pkg/mod/github.com/ory/mail/[email protected]/smtp.go:211
kratos_courier_1 | github.com/ory/kratos/courier.(*courier).dispatchEmail
kratos_courier_1 | /project/courier/smtp.go:173
kratos_courier_1 | github.com/ory/kratos/courier.(*courier).DispatchMessage
kratos_courier_1 | /project/courier/courier_dispatcher.go:13
kratos_courier_1 | github.com/ory/kratos/courier.(*courier).DispatchQueue
kratos_courier_1 | /project/courier/courier_dispatcher.go:65
kratos_courier_1 | github.com/ory/kratos/courier.(*courier).watchMessages.func1
kratos_courier_1 | /project/courier/courier.go:85
kratos_courier_1 | github.com/cenkalti/backoff.RetryNotify
kratos_courier_1 | /go/pkg/mod/github.com/cenkalti/[email protected]+incompatible/retry.go:37
kratos_courier_1 | github.com/cenkalti/backoff.Retry
kratos_courier_1 | /go/pkg/mod/github.com/cenkalti/[email protected]+incompatible/retry.go:24
kratos_courier_1 | github.com/ory/kratos/courier.(*courier).watchMessages
kratos_courier_1 | /project/courier/courier.go:84
kratos_courier_1 | runtime.goexit
kratos_courier_1 | /usr/local/go/src/runtime/asm_amd64.s:1581] [email protected] service_name=Ory Kratos service_version=v0.9.0-alpha.3 smtp_server=localhost:1025 smtp_ssl_enabled=falsefaint-energy-48611
03/29/2022, 9:50 AMhigh-optician-2097
faint-energy-48611
03/29/2022, 9:52 AMfaint-energy-48611
03/29/2022, 9:59 AMwatch-courier: true, it says it's sending out an email, but mailhog/mailslurper doesn't react at all :<high-optician-2097
faint-energy-48611
03/29/2022, 10:30 AMfaint-energy-48611
03/29/2022, 12:20 PMkratos_1 | time=2022-03-29T12:19:47Z level=debug msg=Connecting to SQL Database func=github.com/ory/kratos/driver.(*RegistryDefault).Init.func1 file=/project/driver/registry_default.go:537 audience=application connMaxLifetime=0s idlePool=8 pool=16 service_name=Ory Kratos service_version=v0.9.0-alpha.3
kratos_1 | time=2022-03-29T12:19:48Z level=warning msg=Unable to determine network, retrying. func=github.com/ory/x/logrusx.(*Logger).Logf file=/go/pkg/mod/github.com/ory/[email protected]/logrusx/helper.go:118 audience=application error=map[debug: message:Unable to locate the table reason: stack_trace:
kratos_1 | github.com/ory/x/sqlcon.handleSqlite
kratos_1 | /go/pkg/mod/github.com/ory/[email protected]/sqlcon/error_sqlite.go:26
kratos_1 | github.com/ory/x/sqlcon.HandleError
kratos_1 | /go/pkg/mod/github.com/ory/[email protected]/sqlcon/error.go:89
kratos_1 | github.com/ory/x/networkx.(*Manager).Determine
kratos_1 | /go/pkg/mod/github.com/ory/[email protected]/networkx/manager.go:42
kratos_1 | github.com/ory/kratos/persistence/sql.(*Persister).DetermineNetwork
kratos_1 | /project/persistence/sql/persister.go:80
kratos_1 | github.com/ory/kratos/driver.(*RegistryDefault).Init.func1
kratos_1 | /project/driver/registry_default.go:582
kratos_1 | github.com/cenkalti/backoff.RetryNotify
kratos_1 | /go/pkg/mod/github.com/cenkalti/[email protected]+incompatible/retry.go:37
kratos_1 | github.com/cenkalti/backoff.Retry
kratos_1 | /go/pkg/mod/github.com/cenkalti/[email protected]+incompatible/retry.go:24
kratos_1 | github.com/ory/kratos/driver.(*RegistryDefault).Init
kratos_1 | /project/driver/registry_default.go:523
kratos_1 | github.com/ory/kratos/driver.New
kratos_1 | /project/driver/factory.go:15
kratos_1 | github.com/ory/kratos/cmd/serve.NewServeCmd.func1
kratos_1 | /project/cmd/serve/root.go:33
kratos_1 | github.com/spf13/cobra.(*Command).execute
kratos_1 | /go/pkg/mod/github.com/spf13/[email protected]/command.go:860
kratos_1 | github.com/spf13/cobra.(*Command).ExecuteC
kratos_1 | /go/pkg/mod/github.com/spf13/[email protected]/command.go:974
kratos_1 | github.com/spf13/cobra.(*Command).Execute
kratos_1 | /go/pkg/mod/github.com/spf13/[email protected]/command.go:902
kratos_1 | github.com/ory/kratos/cmd.Execute
kratos_1 | /project/cmd/root.go:48
kratos_1 | main.main
kratos_1 | /project/main.go:35
kratos_1 | runtime.main
kratos_1 | /usr/local/go/src/runtime/proc.go:255
kratos_1 | runtime.goexit
kratos_1 | /usr/local/go/src/runtime/asm_amd64.s:1581 status:Internal Server Error status_code:500] service_name=Ory Kratos service_version=v0.9.0-alpha.3high-optician-2097
faint-energy-48611
03/29/2022, 12:31 PMkratos-migrate_1 | Successfully applied SQL migrations!
kratos_kratos-migrate_1 exited with code 0
The UI works, but when I click on login/signup/recover/verify buttons, I get "The connection was reset" :<faint-energy-48611
03/29/2022, 12:34 PMhigh-optician-2097
faint-energy-48611
03/29/2022, 12:35 PMfaint-energy-48611
03/29/2022, 12:43 PMwatch-courier: true in my YAML config, but apparently it stopped working, because when I've added --watch-courier flag to my kratos serve command in docker-compose, it started sending out emails!high-optician-2097
high-optician-2097
watch-courier in the config file in the official resources somewhere?faint-energy-48611
03/29/2022, 12:45 PMhigh-optician-2097
This is a CLI flag and environment variable and can not be set using the config file.๐
faint-energy-48611
03/29/2022, 12:55 PMfaint-energy-48611
03/29/2022, 12:56 PMfaint-energy-48611
03/29/2022, 12:59 PMhigh-optician-2097
high-optician-2097
ripe-alarm-21163
03/29/2022, 1:06 PMadorable-air-10005
04/06/2022, 3:21 PMfaint-energy-48611
04/06/2022, 3:22 PMkratos courier watch, this might helpripe-alarm-21163
04/06/2022, 3:25 PMkratos:
command: ["serve", "--watch-courier", "--config", "/etc/config/kratos/kratos.yaml", "--dev"]adorable-air-10005
04/06/2022, 3:58 PMadorable-air-10005
04/06/2022, 3:59 PMkratos serve -c "$CONFIG_PATH" --dev --watch-courieradorable-air-10005
04/06/2022, 4:00 PMwatch-courier: trueadorable-air-10005
04/06/2022, 4:00 PMsmtp://test:test@localhost:1025/?skip_starttls=true&skip_ssl_verify=trueripe-alarm-21163
04/06/2022, 4:01 PMthankful-secretary-66849
04/07/2022, 3:22 AM{
"audience": "application",
"error": {
"message": "tls: first record does not look like a TLS handshake"
},
"level": "error",
"message_from": "[email protected]",
"msg": "Unable to send email using SMTP connection.",
"service_name": "Ory Kratos",
"service_version": "v0.9.0-alpha.3",
"smtp_server": "email-smtp.us-east-1.amazonaws.com:587",
"smtp_ssl_enabled": true,
"time": "2022-04-06T23:19:18-04:00"
}thankful-secretary-66849
04/07/2022, 3:27 AMnc -vz email-smtp.us-east-1.amazonaws.com 587
Connection to email-smtp.us-east-1.amazonaws.com port 587 [tcp/submission] succeeded!