What is necessary for a connection to a smtp serve...
# talk-kratos
e
What is necessary for a connection to a smtp server when running locally. (details in thread) Keep getting
msg=Unable to send email using SMTP connection
error=map[message:unencrypted connection stack_trace:stack trace could not be recovered from error type *errors.errorString]
. I followed the docs for smtp security and my connection url is
connection_uri: <smtp://test:test@maildev:1025/?disable_starttls=true>
Copy code
courier:
  smtp:
    connection_uri: <smtp://test:test@maildev:1025/?disable_starttls=true&skip_ssl_verify=true>
Tried this as well This is my compose
Copy code
maildev:
    image: maildev/maildev
    depends_on:
      - traefik
    labels:
      - "traefik.http.routers.maildev.rule=Host(`mail.${VIRTUAL_HOST}`)"
      - "traefik.http.services.maildev-service.loadBalancer.server.port=1080"
    environment:
      MAILDEV_INCOMING_USER: test
      MAILDEV_INCOMING_PASS: test
    networks:
      - platform

  kratos:
    image: oryd/kratos:v1.1.0
    restart: unless-stopped
    depends_on:
      - postgres
      - traefik
      - maildev
    environment:
      DSN: postgres://${PG_USER}:${PG_USER}@${PG_HOST}:${PG_PORT}/${PG_DB}?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=kratos
      LOG_LEVEL: trace
    command: serve -c /etc/config/kratos/kratos.dev.yml --dev --watch-courier
    labels:
      - "traefik.http.routers.kratos-public.rule=Host(`kratos.${VIRTUAL_HOST}`)"
      - "traefik.http.services.kratos-public-service.loadBalancer.server.port=4433"
    volumes:
        - ./config/kratos:/etc/config/kratos
    networks:
      - platform
I verified that the smtp server works fine via a nodejs app
Copy code
import nodemailer from "nodemailer";

const transporter = nodemailer.createTransport({
	host: "maildev",
	port: 1025,
	secure: false,
	auth: {
		user: "test",
		pass: "test",
	},
});
l
kratos uses mailslurper for their test/dev.
e
Yeah but I've seen others used as well in their gh issues. Its should be just an smtp server. The mailslurper doesn't work for me since it behaves weirdly with the reverse proxy setup I have (just kept erroring out without logging anything).
l
have you tried configure it as
smtps
instead?
e
Seems like smtp and disabling the start tls was the way to go!
Copy code
courier:
  smtp:
    connection_uri: <smtp://maildev:1025/?disable_starttls=true>
As simple as
Copy code
maildev:
    image: maildev/maildev
Which is great since the mailslurper is outdated quite a bit
l
👍
it's not that outdated
beside that, yes outdated 😛
but still works 😄
i have not tried proxy the web interface yet.. but it's just HTTP so shouldn't be that hard
e
The docker image that is used in the demos is built from ory fork not mailslurper. https://github.com/ory/mailslurper
l
ya
look at the github of mailslurper, then the years match up 🙂 ory uses mailslurper 1.14.1
which is from 2018