Stalwart: Difference between revisions
→Tips and tricks: Auto update TLSA |
→Sending from subaddresses: Add note on planned feature |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 271: | Line 271: | ||
User = "stalwart-mail"; | User = "stalwart-mail"; | ||
Group = "stalwart-mail"; | Group = "stalwart-mail"; | ||
EnvironmentFile = config.age.secrets. | EnvironmentFile = config.age.secrets.gotlsaflare-cloudflare-token.path; | ||
RuntimeDirectory = "stalwart-tlsa"; | RuntimeDirectory = "stalwart-tlsa"; | ||
}; | }; | ||
environment = { | |||
DOMAIN = "example.org"; | |||
SUBDOMAIN = "mail"; | |||
PORT = "25"; | |||
ACME_PROVIDER_ID = "cloudflare"; | |||
}; | |||
path = with pkgs; [ | path = with pkgs; [ | ||
bash | bash | ||
| Line 288: | Line 293: | ||
set -eu | set -eu | ||
TLSA_RECORD="_$PORT._tcp.$SUBDOMAIN.$DOMAIN" | TLSA_RECORD="_$PORT._tcp.$SUBDOMAIN.$DOMAIN" | ||
DB_PATH="/var/lib/stalwart-mail/db" | DB_PATH="/var/lib/stalwart-mail/db" | ||
| Line 341: | Line 342: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Adapt the variables <code>DOMAIN</code>, <code>SUBDOMAIN</code>, and <code>PORT</code> according to your needs. The variable <code>ACME_PROVIDER_ID</code> corresponds to the ACME profile name you've setup in the Stalwart webadmin interface. <code>EnvironmentFile</code> points to a file containing the secret Cloudflare api token in the format: TOKEN=12345678[...]. | |||
=== Sending from subaddresses === | |||
Receiving mails to subaddresses like <code>john+secondary@example.org</code> is enabled by default. Sending from subaddresses will fail with "You are not allowed to send from this address" as long as they are not an configured alias address. You can disable this check but it will allow any authenticated user to send from any other address. | |||
{{file|/etc/nixos/configuration.nix|nix|3=services.stalwart-mail = { | |||
settings = { | |||
[...] | |||
session.auth.must-match-sender = false; | |||
}; | |||
};}} | |||
A configuration option to customize the pattern of authorized sender addresses is a [https://github.com/stalwartlabs/stalwart/issues/394#issuecomment-3705990056 planned feature]. | |||
=== Test mail server === | === Test mail server === | ||
You can use several online tools to test your mail server configuration: | You can use several online tools to test your mail server configuration: | ||