[GH-ISSUE #4121] Error configuring SMTP: SMTP_SECURITY is invalid. It needs to be one of the following options: starttls, force_tls or off #1790

Closed
opened 2026-03-03 02:12:12 +03:00 by kerem · 1 comment
Owner

Originally created by @mlopezcoria on GitHub (Dec 1, 2023).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4121

Hello,

I'm getting this error message in the docker log:

Error loading config:
`SMTP_SECURITY` is invalid. It needs to be one of the following options: starttls, force_tls or off

But I read the documentation and the environment variables seem to be ok:

version: "3.8"

services:
  vaultwarden:
    image: vaultwarden/server:latest
    restart: always
    networks:
        - frontend
    volumes:
        - ./data:/data
    environment:
        - SMTP_HOST=mail.mydomain.com
        - SMTP_FROM=vaultwarden@mydomain.com
        - SMTP_PORT=587
        - SMTP_SECURITY=starttls
        - SMTP_USERNAME=no-reply@mydomain.com
        - SMTP_PASSWORD=areallysecretpassword

volumes:
  data:

networks:
  frontend:
    external: true

I tried changing SMTP_PORT=25 SMTP_SECURITY=off and also SMTP_PORT=465 SMTP_SECURITY=force_tls but log keeps showing the same error.

Am I doing anything wrong?

Originally created by @mlopezcoria on GitHub (Dec 1, 2023). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4121 Hello, I'm getting this error message in the docker log: ``` Error loading config: `SMTP_SECURITY` is invalid. It needs to be one of the following options: starttls, force_tls or off ``` But I read the documentation and the environment variables seem to be ok: ``` version: "3.8" services: vaultwarden: image: vaultwarden/server:latest restart: always networks: - frontend volumes: - ./data:/data environment: - SMTP_HOST=mail.mydomain.com - SMTP_FROM=vaultwarden@mydomain.com - SMTP_PORT=587 - SMTP_SECURITY=starttls - SMTP_USERNAME=no-reply@mydomain.com - SMTP_PASSWORD=areallysecretpassword volumes: data: networks: frontend: external: true ``` I tried changing `SMTP_PORT=25 SMTP_SECURITY=off` and also `SMTP_PORT=465 SMTP_SECURITY=force_tls` but log keeps showing the same error. Am I doing anything wrong?
kerem closed this issue 2026-03-03 02:12:12 +03:00
Author
Owner

@mlopezcoria commented on GitHub (Dec 1, 2023):

I found the problem: I had to docker compose down && docker compose up -d

<!-- gh-comment-id:1836761273 --> @mlopezcoria commented on GitHub (Dec 1, 2023): I found the problem: I had to `docker compose down && docker compose up -d`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#1790
No description provided.