Commit Graph

119 Commits

Author SHA1 Message Date
Martin Weinelt d04d1a565b docs: reorganize how-to section, create integrations section
Radicale and Roundcube don't fit so well with the other how to's in
that they configure additional external services instead of directly
modifying the NixOS mailserver setup.

We also sort the How-To section alphabetically. his unclutters the nav
somewhat
2026-03-11 01:50:14 +01:00
Martin Weinelt 5e43dafc96 docs: update Flakes example
and add a small example how to deploy with nixos-rebuild.
2026-03-11 01:50:13 +01:00
Martin Weinelt b83621011f docs: update autodiscovery guide 2026-03-11 01:50:13 +01:00
Martin Weinelt 8d996b109d docs: update Roundcube guide
Adds a short explanation what roundcube even is.

Extract and extend the roundcube example showing plugin and spellchecking
support. We also inherit a plausible maximum attachment size based on
Postfix's message_size_limit. The nginx vhost forces TLS and manages
certificates using the ACME integration.
2026-03-11 01:50:13 +01:00
Martin Weinelt cff7a27cfe docs: update Radicale guide
We now explain what Radicale even is and classify reusing the hashed
passwords of login accounts as limitation because it requires using
compatible password hashes.

This is difficult because compatible password hashes need an overlap
between libxcrypt and Radicales choice of libraries: libpass, argon2 and
bcrypt.

Extract the source code into a proper .nix file so we get source linting
and formatting for free. Pruned from bad practices of the past, like
global `with lib`.
2026-03-10 02:02:53 +01:00
Martin Weinelt 1240173034 Merge branch 'fix-rspamd-doc' into 'master'
docs: fix rspamd syntax

See merge request simple-nixos-mailserver/nixos-mailserver!310
2026-03-09 21:00:17 +00:00
Martin Weinelt 6cee3e2360 docs: remove service type key from DKIM DNS binding
Stop explicitly restriciting us to email services. This would require
an update for tlsrpt (s=email:tlsrpt) use but the benefit of restricting
key use like that has limited practical benefit, when there are so very\
few services defined.

Not setting the service type key defaults it to all services (s=*).
2026-03-08 22:53:11 +01:00
Martin Weinelt 80ce71e236 docs/advanced-cofnigurations: expand recommendations
Mention FTS and TLSRPT and explain what these setups are good for and
when they might be required.
2026-03-08 04:36:58 +01:00
Martin Weinelt 3938a7518a docs: fix typo and wording in release notes 2026-03-05 15:51:57 +01:00
Martin Weinelt 85967440af docs: configure ACME HTTP-01 with nginx in setup example 2026-03-05 12:52:04 +01:00
Martin Weinelt c300fdeb63 docs: mention password file option in release notes 2026-03-05 12:51:45 +01:00
Martin Weinelt 034ca15318 docs: suggest mx to refer to mailserver in spf record
Much more foolproof in simple setups, because it allows all servers
mentioned in a domains MX record to also send out mail, without having to
track them here manually again.
2026-02-26 01:03:53 +01:00
Martin Weinelt e437760341 treewide: replace/remove dovecot2 service name
The unit name is now dovecot.service.
2025-12-19 02:52:55 +01:00
Martin Weinelt ff9b046f0f Stop recommending bcrypt everywhere
By passing no method to mkpasswd we make it select the strongest cipher
that libxcrypt recommends.

Replaces the example hashes with yescrypt hashes, which is the current
default.
2025-12-19 02:36:28 +01:00
Martin Weinelt 33ba1ff52b Switch to NixOS ACME module for certificate management
Drop most of the existing certificate handling, because we're effectively
duplicating functionality that NixOS offers for free with better
design, testing and maintainance than what we could provide downstream.

The remaining two options are to reference an
existing `security.acme.certs` configuration through
`mailserver.x509.useACMEHost` or to provide existing key material via
`mailserver.x509.certificateFile` and `mailserver.x509.privateKeyFile`.

Support for automatic creation of self-signed certificates has been
removed, because it is undesirable in public mail setups.

The updated setup guide now displays the recommended configuration that
relies on the NixOS ACME module, but requires further customization to
select a suitable challenge.

Co-Authored-By: Emily <git@emilylange.de>
2025-12-19 02:36:28 +01:00
Martin Weinelt 18ee2a44ed docs: extract setup example into .nix file and include
That way we get linting of the code for free.
2025-12-19 02:17:32 +01:00
yeoldegrove f67ed85b3f docs: fix some typos 2025-12-01 22:16:18 +01:00
emilylange b47decd71a docs: update roundcube example to use implicit TLS
instead of explicit TLS (STARTTLS).

We disabled STARTTLS for IMAP by default in 54f37811dd
and we will likely do the same for (client) SMTP in the future.
2025-11-28 21:53:41 +01:00
Martin Weinelt a38e14460f docs: don't recommend sudo to run the migration script
The migration script tries switching EUID by itself and will error out
with a recommendation to try sudo if it cannot.
2025-11-26 20:18:58 +01:00
Martin Weinelt 039389ee04 docs: recommend wcurl to grab the migration script 2025-11-26 19:57:31 +01:00
Martin Weinelt 8d35f004ee Release 25.11 2025-11-25 13:56:52 +01:00
Martin Weinelt eeda8ba39e Add support for sender rewriting using postsrsd
With SRS we support forwarding of mails without (fully) breaking SPF
alignment.
2025-11-11 13:45:03 +01:00
Martin Weinelt a1532a552f postfix: enable X25519MLKEM768 key exchange
This migrates the key exchange curve group configuration into the OpenSSL
configuration format, which is the only path forward to configure these.

We now prefer a hybrid key exchange for TLS handshake and as a client
we'll send key shares for that and pure X25519, while keeping backwards-
compat for P256 and P384.

The statistics for my personal mail server over the last month show a
clear trend for X25519 key exchanges:

    156 secp384r1
    225 secp256r1
    19541 x25519
2025-11-10 00:31:43 +01:00
Martin Weinelt 3555a546ab Add support for SMTP TLS reports
When enabled the tlsrpt services will send out aggregated reports about
TLS connections the local Postfix made to interested parties, who set up
a `_smtp._tls` TXT record with a rua attribute.

Introduces mailserver.systemContact to specify an administrative contact
advertised in these automated reports.
2025-11-08 22:39:29 +01:00
Martin Weinelt 0812ca1e48 Use postfix-tlspol for DANE/MTA-STS policy lookups
Postfix with plain DANE only secures domains that configure DNSSEC and
publish TLSA records. With postfix-tlspol we support MTA-STS protected
connections and get caching for its policy results.

Finally, we use this as a stepping stone to build TLSRPT support on top.
2025-11-08 15:49:34 +01:00
Martin Weinelt 1337e2eece Disable submission with explicit STARTTLS by default
Deprecated, but not yet scheduled for removal pending user feedback.
2025-11-08 12:50:50 +01:00
Martin Weinelt 54f37811dd Disable plaintext access per RFC 8314
This deprecates the `enableImap` and `enablePop` options and opens them
up for future removal.
2025-09-22 03:46:43 +02:00
Martin Weinelt 2204f55329 Increase default DKIM key bits to 2048
This is the current recommendation in RFC 8301 from early 2018.

Fixes: #333
2025-08-22 22:38:31 +02:00
Martin Weinelt 2b240501e0 Introduce system name and domain options
Bring them up from the DMARC reporting section to the mailserver toplevel
so they become reusable for the upcoming TLSRPT integration.

We default to the first domain in the domains option, if not set
explicitly, so that `systemDomain` doesn't become a blocker for existing
setups. We still encourage picking out the intended one, which is likely
the one used for the MX hostname.

This also simplifies the DMARC reporting configuration, which doesn't
need to be so fine-grained.

Co-Authored-By: Emily <git@emilylange.de>
2025-07-09 01:44:10 +02:00
emilylange 6ef1eb9ce1 assertions: fix eval error when mailserver.stateVersion is unset (null)
Eval does not stop on the first assertion failure it encouters.
Instead, it tries to evaluate all assertions and returns with a list of
those that failed.

This means our very top `config.mailserver.stateVersion != null`
assertion does not gate against any other assertions trying to compare
null against an integer.

The error prior to this commit can be reproduced by removing
`mailserver.stateVersion = 999;` in tests/lib/config.nix and then trying
to evaluate any of the tests:

~~~bash
# nix eval --raw .#checks.x86_64-linux.internal-unstable
error:
       … while evaluating the attribute 'outPath'
         at /nix/store/syvnmj3hhckkbncm94kfkbl76qsdqqj3-source/lib/customisation.nix:421:7:
          420|         drv.drvPath;
          421|       outPath =
             |       ^
          422|         assert condition;

       … while calling the 'getAttr' builtin
         at «internal»:1:500:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: cannot compare null with an integer
~~~
2025-06-21 20:15:46 +02:00
Martin Weinelt 62ea8a7e00 dovecot: migrate to dedicated homedir and separate maildir paths
Per the dovecot documentation[0] we were previously running with an
unsupported home directory configuration, because we shared them among
all virtual users at /var/vmail.

After resolving this by creating per user home directories at
/var/vmail/%{domain}/%{user} this now also overlaps with the location of
the Maildir, which is not recommended.

As a result we now need to migrate our Maildirs into
/var/vmail/%{domain}/%{user}/mail, for which a small shell script is
provided as part of this change.

The script is included in the documentation because we cannot provide it
in time for users, because they might already be seeing the relevant
assertion and there is no safe waiting period that would allow us to skip
shipping it like that.

[0] https://doc.dovecot.org/2.3/configuration_manual/mail_location/
2025-06-21 09:46:32 +02:00
Martin Weinelt 5c1b9921e6 Merge branch 'suggest-dmarc' into 'master'
Suggest that folks enable DMARC reporting

See merge request simple-nixos-mailserver/nixos-mailserver!377
2025-06-15 23:15:19 +00:00
Martin Weinelt e0ab4eeb67 docs/setup-guide: bump example stateVersion to 2
If you do a fresh install now you should be able to skip the first
migration step.
2025-06-14 01:20:27 +02:00
Guillaume Girol 49980abd25 mention spam and ham training data in backup guide 2025-06-06 12:00:00 +00:00
Martin Weinelt d6d6308ba2 Merge branch 'doc-backup-sieve' into 'master'
docs/backup-guide: add recommendation for sieveDirectory

See merge request simple-nixos-mailserver/nixos-mailserver!405
2025-06-02 14:57:24 +00:00
Tom Herbers c4628a4c04 docs/backup-guide: add recommendation for sieveDirectory
Co-authored-by: Martin Weinelt <martin+gitlab@linuxlounge.net>
2025-06-02 11:27:09 +02:00
Martin Weinelt 8c835feaa7 docs/migrations: Improve title scoping for LDAP home dir migration 2025-06-02 04:31:41 +02:00
Martin Weinelt c9f61e02ae docs/howto-develop: fix stateVersion assertion example 2025-05-31 13:06:29 +02:00
Martin Weinelt ffd0e6f8f2 Merge branch 'dont-hardcode-ldap-home-base' into 'master'
dovecot: respect the mailDirectory base for LDAP home directories

See merge request simple-nixos-mailserver/nixos-mailserver!400
2025-05-29 21:14:25 +00:00
Martin Weinelt 7cb61e6e3a dovecot: respect the mailDirectory base for LDAP home directories
This change is safe, if you have not altered the default value of the
 `mailserver.mailDirectory` setting.
2025-05-29 23:10:33 +02:00
Martin Weinelt 10cccc7706 docs: fix code block syntax in migration init 2025-05-29 08:48:56 +02:00
Martin Weinelt 6a78dc3375 Merge branch 'stateVersion' into 'master'
Introduce stateVersion concept

See merge request simple-nixos-mailserver/nixos-mailserver!401
2025-05-29 06:14:17 +00:00
Martin Weinelt 792225e256 Introduce stateVersion concept
With upcoming changes to the dovecot home and maildirectories we need to
introduce a way to nudge users to inform themselves about manual
migration steps they might need to carry out.

The idea here is to allow us to safely make breaking changes and notify
the user of required migration steps at eval time, so they can make the
necessary changes in time.
2025-05-27 23:54:15 +02:00
Martin Weinelt 51d48f1492 Release 25.11 2025-05-22 01:31:46 +02:00
Martin Weinelt b4ae17d224 Reformat release notes 2025-05-21 00:58:06 +02:00
euxane e287d83ab1 release-notes: mention switch to fts-flatcurve for FTS 2025-05-19 16:45:09 +02:00
euxane 2ed7a94782 dovecot/fts: switch to fts-flatcurve
This switches the full-text search plugin from fts-xapian to
fts-flatcurve, the now preferred indexer still powered by Xapian,
which will be integrated into Dovecot core 2.4.

This sets a sane minimal configuration for the plugin with
international language support.

The plugin options marked as "advanced" in Dovecot's documentation
aren't re-exposed for simplicity. They can nevertheless be overridden
by module consumers by directly setting keys with
`services.dovecot2.pluginSettings.fts_*`.

The `fullTextSearch.maintenance` option is removed as the index is now
incrementally optimised in the background.

GitLab: closes https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/issues/239
2025-05-19 16:45:09 +02:00
Martin Weinelt fce540024a docs/howto-develop: document the devshell 2025-05-15 16:29:05 +02:00
Martin Weinelt 040f07ff45 docs/howto-develop: update chat room references 2025-05-15 16:29:05 +02:00
Martin Weinelt a73982f5b4 docs: migrate wiki references to wiki.nixos.org
This has been the official wiki platform for a while now.
2025-05-15 16:29:05 +02:00