Commit Graph

980 Commits

Author SHA1 Message Date
Martin Weinelt 59eae7f3d0 tests/ldap: remove redundant settings
All of thsese are already option defaults.
2026-03-21 22:34:50 +01:00
Martin Weinelt a70ae543cb docs: add baseline ldap documentation
within the new account backends nav section.
2026-03-21 22:34:50 +01:00
Martin Weinelt 63365fb1a8 postfix: document ldap map purposes 2026-03-21 01:38:04 +01:00
Martin Weinelt 762f553643 ldap: make uid the default account name
I fail to understand how mail became the uidAttribute way back when LDAP
support was introduced, but it was unintentional and clearly a mistake.

The uid attribute is the standard system login name per RFC4519 2.39 and
what we default to going forward.
2026-03-21 01:38:04 +01:00
Martin Weinelt a87d01ea79 ldap: reorganize and regroup options
Now that we have more experience with how we use the LDAP module options
we can make smarter decisions in how to organize them. We can also
explain much better what these options imply, which results in more
extensive option documentation.
2026-03-21 01:38:04 +01:00
Martin Weinelt 609fd80936 dovecot: make sure vid/gid are not overridable
The only storage scheme we support is a single declarative user with
fixed uid/gid. The default_fields are overridable if these fields leak
in from LDAP, so promote them to override_fields instead.
2026-03-21 00:47:59 +01:00
Martin Weinelt af480dba87 ldap: replace pass_attrs option with password attr option
The passdb only checks password access, so instead of customizing the
whole pass_attrs setting we now allow customization of the password field
used.
2026-03-21 00:47:59 +01:00
Martin Weinelt 091eda1ed2 ldap: migrate to UUID based Dovecot home directories
The LDAP support was not in a good shape when it was merged. This is a
breaking change and course correction to apply best practices going
forward.

This fixes various issues experienced with the Dovecot LDAP home
directory.

The gravest issue is that the `homeDirectory` attribute from
the `posixAccount` schema would overwrite the Dovecot home directory and
cause permission errors. This was possible because we defined the home
variable in `default_fields` that is inherently mutable and just a preset
if no other value gets transmitted from LDAP. This did not surface in
tests, because our LDAP schema was too minimal compared to a common
production dataset.

The most annoying issue and the actual breaking change is that we now
default to UUID based home directories. Every entry in an IDM that
supports LDAP comes with a unique identifier that does not change upon
account name changes. We want those to enable simple account name
migrations that don't require any manual data migration.

To migrate existing dovecot home directories a migration script is
included, which will be backported to the 25.11 release, so the migration
can already be started from the previous release version.
2026-03-21 00:47:59 +01:00
Martin Weinelt fa0d5c9694 tests/ldap: fail fast if openldap schema is broken
This helps so much during development as it tells me openldap failed and
doesn't require me to do a root cause analysis on a postmap failure much
later in during the test.
2026-03-21 00:47:59 +01:00
Martin Weinelt 05968d7978 Merge branch 'add-option-custom-reject-sender-message' into 'master'
Add rejectSenderMessage option

See merge request simple-nixos-mailserver/nixos-mailserver!453
2026-03-20 10:16:09 +00:00
lennart 5544b0fa70 Add rejectSenderMessage option 2026-03-20 10:16:09 +00:00
Martin Weinelt fb3350c188 Merge branch 'roundcube-doc-plugin-maxsize-fix' into 'master'
docs/roundcube: fix mistakes in the example and add examples for caddy and managesieve

See merge request simple-nixos-mailserver/nixos-mailserver!499
2026-03-19 20:32:02 +00:00
headpats 3dc19d30d1 docs/roundcube: add caddy example 2026-03-19 13:36:00 +01:00
headpats cbf450f06c docs/roundcube: fix typo in nginx vhost 2026-03-19 13:36:00 +01:00
headpats bf481fd2e5 docs/roundcube: add managesieve example 2026-03-19 13:36:00 +01:00
headpats 8d5aa0b27a docs/roundcube: attachment size workaround is now handled by the module 2026-03-19 13:35:52 +01:00
Martin Weinelt b442cb49ee Merge branch 'dovecot-rsa-compat' into 'master'
dovecot: restore compat for RSA key material

See merge request simple-nixos-mailserver/nixos-mailserver!500
2026-03-19 08:55:14 +00:00
Martin Weinelt 3da442701a dovecot: restore compat for RSA key material
In TLS1.2 available cipher suites depend on the available key material,
so the last round of cipher suites updates broke TLS1.2 support with RSA
key pairs.

The NixOS ACME module has been defaulting to EC256 (and earlier EC384)
key material, so I assume this did not affect many setups in practice.
2026-03-18 14:06:10 +01:00
headpats 83a669fb2f docs/roundcube: fix persistent_login plugin not being activated 2026-03-18 05:58:41 +01:00
Martin Weinelt 7dfcb21d35 scripts/generate-options: fix typing issue 2026-03-15 19:24:49 +01:00
Martin Weinelt 75f9549a81 Merge branch 'pr/misc-fix' into 'master'
a few fixes

See merge request simple-nixos-mailserver/nixos-mailserver!497
2026-03-15 00:36:10 +00:00
Lin Jian 6606537c0f docs/setup-guide: fix name of DKIM record
ref: 4089d73b51
ref: !488
2026-03-15 05:49:10 +08:00
Lin Jian 4a8f0c9da6 Fix option typo
ref: 6ff4a50f02
ref: !484
2026-03-15 05:49:10 +08:00
Lin Jian e31adfca1a Add missing mkRenamedOptionModule for dkimKeyBits
ref: 6ff4a50f02
ref: !484
2026-03-15 05:49:10 +08:00
Martin Weinelt 58587e09bd Merge branch 'deprecations' into 'master'
Deprecate borgbackup, rsnapshot, monit integrations

See merge request simple-nixos-mailserver/nixos-mailserver!494
2026-03-14 11:18:04 +00:00
Martin Weinelt 33b8946c87 Deprecate borgbackup, rsnapshot, monit integrations
The plan is to start warning now with the intent to remove these
integrations before the 26.11 release.
2026-03-14 04:30:39 +01:00
Martin Weinelt 86579c6715 Merge branch 'qol-changes' into 'master'
treewide: inline language instructions, reorganize imports

See merge request simple-nixos-mailserver/nixos-mailserver!492
2026-03-12 12:51:08 +00:00
Martin Weinelt fdcb28e97e git-blame-ignore-revs: init
Adds a mechanism to track and subsequently ignore non-functional treewide
changes during git blame.
2026-03-12 13:43:09 +01:00
Martin Weinelt 271e6e54fd Reorganize imports
With the growing number of option refactors centralize the module import
within the mail-server directory.

Also group deprecations by release, so we can eventually yank them in
bulk after a while.
2026-03-12 13:21:51 +01:00
Martin Weinelt 06cc71c76e treewide: add language annotations for inline code
Instruct editors to correctly highlight and evaluate inline code blocks.
2026-03-12 12:59:03 +01:00
Martin Weinelt 405f2180d4 Merge branch 'docs-version' into 'master'
docs: set version to fix epub3 build

See merge request simple-nixos-mailserver/nixos-mailserver!491
2026-03-11 23:56:17 +00:00
Martin Weinelt 73d3ff008d docs: set version to fix epub3 build
>  WARNING: conf value "version" should not be empty for EPUB3
2026-03-12 00:52:00 +01:00
Martin Weinelt ed13d8e253 Merge branch 'dkim-key-management' into 'master'
Add support for DKIM key management

Closes #341

See merge request simple-nixos-mailserver/nixos-mailserver!484
2026-03-11 23:42:22 +00:00
Martin Weinelt 6ff4a50f02 Add support for DKIM key management
After bumping the generation of new DKIM keys to RSA 2048 in NixOS 25.11
key rotation for existing users could not be done safely.

To resolve this situation we now support multiple generations of
selectors per domain to enable proper DKIM key transitions as described
in RFC6376 3.1. The added documentation introduces and motivates DKIM
and guides the user through a DKIM key rotation.

Additionally, DKIM key material can now also be treated as a managed
secrets when autogenerated state on the mail server host is undesirable.

This change is fully backwards compatible in behavior and will continue
to use the previously generated DKIM key without any additional
configuration up until the point when DKIM selectors are configured
explicitly.
2026-03-11 22:37:49 +01:00
Martin Weinelt ea775773d9 docs: fail build on warnings 2026-03-11 17:01:39 +01:00
Martin Weinelt 489fbc4e0e Merge branch 'setup-guide-next' into 'master'
docs/setup-{guide,example}: refresh the whole guide

See merge request simple-nixos-mailserver/nixos-mailserver!488
2026-03-11 02:04:26 +00:00
Martin Weinelt 4089d73b51 docs/setup-{guide,example}: refresh the whole guide
- add many motivation, helpful comments and important details
- improve formatting through use of more native sphinx/rst elements, like
  the csv-table for DNS records
- clarify the basic requirements
- use dig for uncached DNS propagation checks against an authoritative
  nameserver
- explain the basic feature set of the setup example
- adjust DNS TTLs; 1h is a common duration in modern setups and does not
  hurt caching much
- remove mention of the announce mailinglist, users can just expect
  releases to be ready around branch-off
2026-03-11 02:58:55 +01:00
Martin Weinelt 88889601b9 Merge branch 'docs-update' into 'master'
docs: update how-to guides, split off integrations

See merge request simple-nixos-mailserver/nixos-mailserver!490
2026-03-11 00:54:08 +00:00
Martin Weinelt 1c57aab586 treewide: fix typos and other minor issues 2026-03-11 01:50:14 +01:00
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 77205f744e Merge branch 'flake-update' into 'master'
flake.lock: Update

See merge request simple-nixos-mailserver/nixos-mailserver!489
2026-03-09 12:36:54 +00:00
Martin Weinelt 3758b622f2 flake.lock: Update
Flake lock file updates:

• Updated input 'git-hooks':
    'github:cachix/git-hooks.nix/39f53203a8458c330f61cc0759fe243f0ac0d198' (2026-03-04)
  → 'github:cachix/git-hooks.nix/8baab586afc9c9b57645a734c820e4ac0a604af9' (2026-03-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d2acf504d602c98f5ec2518dacea4f35e5a4e50f' (2026-03-05)
  → 'github:NixOS/nixpkgs/0c6c0dd2469abaa216599bb19bbf77a328af6564' (2026-03-09)
2026-03-09 13:27:02 +01:00
Martin Weinelt c292d31ee7 Merge branch 'dkim-dns-binding-no-service' into 'master'
docs: remove service type key from DKIM DNS binding

See merge request simple-nixos-mailserver/nixos-mailserver!487
2026-03-08 21:56:45 +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