Stalwart: Difference between revisions
Update example config for new version |
|||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 2: | Line 2: | ||
== Setup == | == Setup == | ||
The following example enables the Stalwart mail server for the domain ''example.org'', listening on mail delivery SMTP/Submission (<code>25, 465</code>), IMAPS (<code>993</code>) and JMAP ports (8080/443) for mail clients to connect to. Mailboxes for the accounts <code>postmaster@example.org</code> and <code>user1@example.org</code> get created if they don't exist yet. | The following example enables the Stalwart mail server for the domain ''example.org'', listening on mail delivery SMTP/Submission (<code>25, 465</code>), IMAPS (<code>993</code>) and JMAP ports (8080/443) for mail clients to connect to. Mailboxes for the accounts <code>postmaster@example.org</code> and <code>user1@example.org</code> get created if they don't exist yet. | ||
{{file|/etc/nixos/configuration.nix|nix|3=environment.etc = { | |||
"stalwart/mail-pw1".text = "foobar"; | "stalwart/mail-pw1".text = "foobar"; | ||
"stalwart/mail-pw2".text = "foobar"; | "stalwart/mail-pw2".text = "foobar"; | ||
| Line 11: | Line 13: | ||
services.stalwart-mail = { | services.stalwart-mail = { | ||
enable = true; | enable = true; | ||
package = pkgs.stalwart-mail; | package = pkgs.stalwart-mail; | ||
openFirewall = true; | openFirewall = true; | ||
settings = { | settings = { | ||
server = { | server = { | ||
hostname = "example.org"; | hostname = "mx1.example.org"; | ||
tls = { | tls = { | ||
enable = true; | enable = true; | ||
| Line 63: | Line 64: | ||
storage.directory = "in-memory"; | storage.directory = "in-memory"; | ||
session.rcpt.directory = "'in-memory'"; | session.rcpt.directory = "'in-memory'"; | ||
queue. | queue.strategy.route = "'local'" | ||
directory."imap".lookup.domains = [ "example.org" ]; | directory."imap".lookup.domains = [ "example.org" ]; | ||
directory."in-memory" = { | directory."in-memory" = { | ||
| Line 94: | Line 95: | ||
"webadmin.example.org" = { | "webadmin.example.org" = { | ||
extraConfig = '' | extraConfig = '' | ||
reverse_proxy http://127.0. | reverse_proxy http://127.0.0.1:8080 | ||
''; | ''; | ||
serverAliases = [ | serverAliases = [ | ||
| Line 104: | Line 105: | ||
}; | }; | ||
}; | }; | ||
};}}TLS key generation is done using DNS-01 challenge through Cloudflare domain provider, see dns-update library for [https://github.com/stalwartlabs/dns-update further providers] or configure [https://stalw.art/docs/server/tls/certificates manual certificates]. | };}} | ||
TLS key generation is done using DNS-01 challenge through Cloudflare domain provider, see dns-update library for [https://github.com/stalwartlabs/dns-update further providers] or configure [https://stalw.art/docs/server/tls/certificates manual certificates]. | |||
== Configuration == | == Configuration == | ||
| Line 156: | Line 159: | ||
The following minimal configuration example is unsecure and for testing purpose only. It will run the Stalwart mail server on <code>localhost</code>, listening on port <code>143</code> (IMAP) and <code>587</code> (Submission). Users <code>alice</code> and <code>bob</code> are configured with the password <code>foobar</code>.{{file|/etc/nixos/configuration.nix|nix|3=services.stalwart-mail = { | The following minimal configuration example is unsecure and for testing purpose only. It will run the Stalwart mail server on <code>localhost</code>, listening on port <code>143</code> (IMAP) and <code>587</code> (Submission). Users <code>alice</code> and <code>bob</code> are configured with the password <code>foobar</code>.{{file|/etc/nixos/configuration.nix|nix|3=services.stalwart-mail = { | ||
enable = true; | enable = true; | ||
settings = { | settings = { | ||
server = { | server = { | ||