square-napkin-92357
05/29/2025, 6:26 AMbrief-egg-61061
05/29/2025, 6:26 AMbrief-egg-61061
05/29/2025, 6:26 AM4436
for the web UI and on port 1025
for SMTP. 2. Configure Ory Kratos to Use MailSlurper In your Kratos configuration file (typically kratos.yml
), set the SMTP settings to point to MailSlurper: yaml courier: smtp: connection_uri: <smtp://localhost:1025/?skip_ssl_verify=true>
This tells Kratos to send all emails (including verification emails) to the MailSlurper SMTP server running locally. 3. Trigger a Verification Email When a user registers or requests email verification, Kratos will send the verification email to MailSlurper. 4. View the Email in MailSlurper Open the MailSlurper UI at [http://127.0.0.1:4436](http://127.0.0.1:4436) to see the captured verification email. You can then click the verification link or use the code as needed. This setup is demonstrated in the Ory Kratos quickstart, which uses MailSlurper to show how email verification works in a development environment. The quickstart guide provides more context on the network architecture and how MailSlurper fits into the workflow [Kratos Quickstart - Network Architecture](https://www.ory.sh/docs/kratos/quickstart#network-architecture), [Kratos Quickstart - Email Verification](https://www.ory.sh/docs/kratos/quickstart#email-verification). Note: MailSlurper is intended for development and testing only. For production, use a real SMTP server. If you need more details on configuring SMTP for Kratos, refer to the [Ory Kratos Email and SMS Guide](https://www.ory.sh/docs/guides/email-sms).square-napkin-92357
05/29/2025, 6:45 AMcourier:
smtp:
connection_uri: <smtp://md-delete-mailslurper-1:1025/?skip_ssl_verify=true>
mailslurper log
2025-05-29 13:38:29 time="2025-05-29T06:38:29Z" level=info msg="Worker 1 queued to handle connections from 172.26.0.6:44828" who="SMTP Server Pool"
2025-05-29 13:38:39 time="2025-05-29T06:38:39Z" level=info msg="Connection closed" connection="172.26.0.6:44828" who="Connection Manager"
2025-05-29 13:38:39 time="2025-05-29T06:38:39Z" level=info msg="Connection closed" connection="172.26.0.6:44828" who="Connection Manager"
2025-05-29 13:38:40 time="2025-05-29T06:38:40Z" level=info msg="Worker 2 queued to handle connections from 172.26.0.6:48992" who="SMTP Server Pool"
2025-05-29 13:38:40 time="2025-05-29T06:38:40Z" level=info msg="Connection closed" connection="172.26.0.6:44828" who="Connection Manager"
2025-05-29 13:38:50 time="2025-05-29T06:38:50Z" level=info msg="Connection closed" connection="172.26.0.6:48992" who="Connection Manager"
2025-05-29 13:38:51 time="2025-05-29T06:38:51Z" level=info msg="Worker 3 queued to handle connections from 172.26.0.6:40958" who="SMTP Server Pool"
2025-05-29 13:38:51 time="2025-05-29T06:38:51Z" level=info msg="Connection closed" connection="172.26.0.6:44828" who="Connection Manager"
2025-05-29 13:39:01 time="2025-05-29T06:39:01Z" level=info msg="Connection closed" connection="172.26.0.6:40958" who="Connection Manager"
2025-05-29 13:39:02 time="2025-05-29T06:39:02Z" level=info msg="Worker 4 queued to handle connections from 172.26.0.6:39904" who="SMTP Server Pool"
2025-05-29 13:39:02 time="2025-05-29T06:39:02Z" level=info msg="Connection closed" connection="172.26.0.6:48992" who="Connection Manager"
2025-05-29 13:39:10 time="2025-05-29T06:39:10Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:12 time="2025-05-29T06:39:12Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:12 time="2025-05-29T06:39:12Z" level=info msg="Connection closed" connection="172.26.0.6:39904" who="Connection Manager"
2025-05-29 13:39:13 time="2025-05-29T06:39:13Z" level=info msg="Worker 5 queued to handle connections from 172.26.0.6:48516" who="SMTP Server Pool"
2025-05-29 13:39:13 time="2025-05-29T06:39:13Z" level=info msg="Connection closed" connection="172.26.0.6:44828" who="Connection Manager"
2025-05-29 13:39:15 time="2025-05-29T06:39:15Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:16 time="2025-05-29T06:39:16Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:16 time="2025-05-29T06:39:16Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:17 time="2025-05-29T06:39:17Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:23 time="2025-05-29T06:39:23Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:23 time="2025-05-29T06:39:23Z" level=info msg="Connection closed" connection="172.26.0.6:48516" who="Connection Manager"
2025-05-29 13:39:24 time="2025-05-29T06:39:24Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:24 time="2025-05-29T06:39:24Z" level=info msg="Mail collection page 1 retrieved" who=ServiceController
2025-05-29 13:39:24 time="2025-05-29T06:39:24Z" level=info msg="Worker 6 queued to handle connections from 172.26.0.6:35324" who="SMTP Server Pool"
2025-05-29 13:39:24 time="2025-05-29T06:39:24Z" level=info msg="Connection closed" connection="172.26.0.6:40958" who="Connection Manager"
2025-05-29 13:39:34 time="2025-05-29T06:39:34Z" level=info msg="Connection closed" connection="172.26.0.6:35324" who="Connection Manager"
I get error
2025-05-29 13:39:34 {"audience":"application","error":{"message":"read tcp 172.26.0.6:35324->172.26.0.3:1025: i/o timeout","stack_trace":"\<http://ngithub.com/ory/kratos/courier.(*SMTPChannel).Dispatch|ngithub.com/ory/kratos/courier.(*SMTPChannel).Dispatch>\n\t/project/courier/smtp_channel.go:110\ngithub.com/ory/kratos/courier.(*courier).DispatchMessage\n\t/project/courier/courier_dispatcher.go:35\ngithub.com/ory/kratos/courier.(*courier).DispatchQueue\n\t/project/courier/courier_dispatcher.go:82\ngithub.com/ory/kratos/courier.(*courier).watchMessages.func1\n\t/project/courier/courier.go:119\ngithub.com/cenkalti/backoff.RetryNotify\n\t/go/pkg/mod/github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:37\ngithub.com/cenkalti/backoff.Retry\n\t/go/pkg/mod/github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:24\ngithub.com/ory/kratos/courier.(*courier).watchMessages\n\t/project/courier/courier.go:118\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1223"},"level":"error","message_from":"<mailto:no-reply@ory.kratos.sh|no-reply@ory.kratos.sh>","message_id":"01de3af9-7c45-4a8e-9d8d-adbbedc50846","message_nid":"d7c395a7-f0f6-4836-9d7c-1fe3cfddbdd6","message_subject":"Please verify your email address","message_template_type":"verification_code_valid","message_type":"email","msg":"Unable to send email using SMTP connection.","service_name":"Ory Kratos","service_version":"v1.3.1","smtp_server":"md-delete-mailslurper-1:1025","smtp_ssl_enabled":false,"time":"2025-05-29T06:39:34.893967048Z"}
2025-05-29 13:39:35 {"audience":"application","level":"warning","message_id":"01de3af9-7c45-4a8e-9d8d-adbbedc50846","message_nid":"d7c395a7-f0f6-4836-9d7c-1fe3cfddbdd6","message_subject":"Please verify your email address","message_template_type":"verification_code_valid","message_type":"email","msg":"Message was abandoned because it did not deliver after 6 attempts","service_name":"Ory Kratos","service_version":"v1.3.1","time":"2025-05-29T06:39:35.90803584Z"}
please guide me how to fix?brief-egg-61061
05/29/2025, 6:45 AMbrief-egg-61061
05/29/2025, 6:46 AMmd-delete-mailslurper-1
must be resolvable from the Kratos container. Try using the container's IP or ensure the service name is correct. 2. Verify MailSlurper is Running and Listening MailSlurper should be running and listening on port 1025
for SMTP. You can check this by running: sh docker exec -it <kratos-container> nc -vz md-delete-mailslurper-1 1025
This should report that the port is open. If not, there is a networking or service issue. 3. Correct SMTP URI Your configuration looks correct for development: yaml courier: smtp: connection_uri: <smtp://md-delete-mailslurper-1:1025/?skip_ssl_verify=true>
This matches the recommended setup for using MailSlurper with Kratos in development environments [Kratos Quickstart - Network Architecture](https://www.ory.sh/docs/kratos/quickstart#network-architecture). 4. MailSlurper Logs Your MailSlurper logs show connections are being opened and then closed, but there is no indication that emails are being received. This could mean: - The connection is being established, but the SMTP conversation is not completing. - There is a firewall or security group blocking traffic. - MailSlurper is not healthy or is misconfigured. 5. Kratos Logs The error message in Kratos is: "error":{"message":"read tcp ...: i/o timeout"}
This means Kratos is able to connect, but the SMTP server (MailSlurper) is not responding in time. 6. Try Using localhost
or Container IP If possible, try using localhost
or the direct IP address of the MailSlurper container, if both are running on the same host or network. 7. MailSlurper Health Make sure MailSlurper is not overloaded or stuck. Restarting the MailSlurper container can sometimes resolve transient issues. 8. Check for Port Conflicts Ensure no other service is using port 1025
on the network. Summary: - Double-check that the hostname md-delete-mailslurper-1
is correct and resolvable from the Kratos container. - Ensure MailSlurper is running and listening on port 1025
. - Use network tools (like nc
or telnet
) from within the Kratos container to verify connectivity. - Review MailSlurper logs for errors or warnings about SMTP connections. - Restart both containers if needed. If after these steps the issue persists, please provide more details about your Docker Compose or deployment setup, as the knowledge sources do not provide further troubleshooting steps for this specific i/o timeout error with MailSlurper and Kratos. For more on configuring SMTP with Kratos, see [Ory Kratos Email and SMS Guide](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp) and for MailSlurper usage in the quickstart, see [Kratos Quickstart - Network Architecture](https://www.ory.sh/docs/kratos/quickstart#network-architecture).square-napkin-92357
05/29/2025, 6:48 AMbrief-egg-61061
05/29/2025, 6:48 AMbrief-egg-61061
05/29/2025, 6:48 AM