SMTP does not work

Hello everyone! i’m trying to configure SMTP and getting this error. Is anyone having similar problem?

vaultwarden  | [2022-08-11 09:19:37.767][vaultwarden::mail][ERROR] SMTP Connection error: Connection error: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1914: (Hostname mismatch)
vaultwarden  | [2022-08-11 09:19:37.768][response][INFO] (test_smtp) POST /admin/test/smtp => 400 Bad Request

That’s how my configuration looks:

version: '3'

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    volumes:
      - ./vw-data:/data
    ports:
      - 8732:80
    environment:
      WEBSOCKET_ENABLED: "true"  # Enable WebSocket notifications.
      SIGNUPS_ALLOWED: "false"
      #SIGNUPS_DOMAINS_WHITELIST: "example.com"
      #SIGNUPS_VERIFY: "true"

      SMTP_HOST: smtp.exampe.com
      SMTP_FROM: vaultwarden@exampe.com
      SMTP_FROM_NAME: Password vault
      SMTP_PORT: 587
      SMTP_SECURITY: starttls
      SMTP_USERNAME: vaultwarden@exampe.com
      SMTP_PASSWORD: Password!

Hi,

are you trying to use your own SMTP server or a public one? The message Hostname mismatch typically means that there is a mismatch between the SMTP server hostname you provided and the hostname (and SAN) in the SSL certificate.

I can’t find an option to ignore SSL warnings (which you should fix instead of ignoring them): SMTP Configuration · dani-garcia/vaultwarden Wiki · GitHub

Maybe you could give a bit more information about your setup.

Wolfgang