mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-17 01:12:27 -05:00
[PR #5995] [CLOSED] Add separate mailing domain support #12564
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/5995
Author: @mohammadmaso
Created: 6/28/2025
Status: ❌ Closed
Base:
main← Head:mailing_domain📝 Commits (4)
98d12ferefactor email URL generation to use effective mailing domaine35de74add mailing_domain configuration option and effective_mailing_domain method74912a0add mailing domain configuration documentation5502114Merge branch 'main' into mailing_domain📊 Changes
3 files changed (+89 additions, -27 deletions)
View changed files
➕
MAILING_DOMAIN.md(+54 -0)📝
src/config.rs(+8 -0)📝
src/mail.rs(+27 -27)📄 Description
Mailing Domain Configuration
This feature allows you to configure a separate domain specifically for email templates and links, while keeping your main
DOMAINsetting for internal server access.Configuration
Environment Variable
Set the
MAILING_DOMAINenvironment variable:Docker Environment
Add to your docker-compose.yml or docker run command:
Or with docker run:
Admin Panel
The mailing domain can also be configured through the admin panel under SMTP Email Settings.
Use Cases
Internal vs Public Access: Your Vaultwarden server runs on an internal domain (e.g.,
http://vaultwarden.internal) but you want emails to contain links to a public domain (e.g.,https://vault.company.com).Development vs Production: Use different domains for email links in development and production environments.
Load Balancer/Proxy: Your server runs behind a load balancer with a different internal address than the public-facing URL.
Behavior
MAILING_DOMAINis set, all email templates will use this domain for links and referencesMAILING_DOMAINis not set, the system falls back to using the mainDOMAINsettingExample
With this configuration:
http://vaultwarden.internal:8080https://vault.company.com🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.