Commit graph

665 commits

Author SHA1 Message Date
Felix Buehler 15d06237b7 nixos/services.dkimproxy-out: remove with lib; 2024-08-30 22:59:25 +02:00
Felix Buehler aa62d49bd7 nixos/services.davmail: remove with lib; 2024-08-30 22:59:25 +02:00
Felix Buehler 68dee151ef nixos/services.clamsmtp: remove with lib; 2024-08-30 22:59:24 +02:00
Sandro 48a0aa7f87
nixos/automx2: init (#333320) 2024-08-29 16:08:22 +02:00
Philip Taron c555de0288
nixos/services.mailman: remove with lib; (#337092) 2024-08-28 21:29:16 -07:00
Philip Taron 03f36dc3c8
nixos/services.postfix: remove with lib; (#337767) 2024-08-28 15:03:44 -07:00
Felix Buehler e2ff604f85 nixos/services.postfix: remove with lib; 2024-08-27 20:57:37 +02:00
Felix Buehler fa20162c79 nixos/services.sympa: remove with lib; 2024-08-27 19:59:19 +02:00
Felix Buehler 0c91ea6ec1 nixos/services.mailman: remove with lib; 2024-08-24 23:20:06 +02:00
Maximilian Bosch f07601ce07
nixos/mailpit: fix defaults for listen/smtp 2024-08-14 16:12:57 +02:00
Maximilian Bosch 15dab820a6
nixos/mailpit: allow multiple instances
Now it's possible to start multiple mailpit instances - for e.g.
multiple testing environments - on the same machine:

    {
      services.mailpit.instances = {
        dev = { /* ... */ };
        staging = { /* ... */ };
      };
    }

The simplest way to start a single instance is by declaring

    services.mailpit.instances.default = {};
2024-08-14 11:33:52 +02:00
Maximilian Bosch a2437d8075
nixos/mailpit: init
Simple module to configure a systemd service for mailpit.
2024-08-14 11:33:52 +02:00
Pol Dellaiera a0a63aa8d4
Merge pull request #332593 from mzacho/master
nixos/modules/services/mail: add protonmail-bridge service
2024-08-13 21:08:24 +02:00
Sandro e32c796ff7
Merge pull request #332541 from SuperSandro2000/mailman-relay-assert
nixos/mailman: allow setting relay domains with services.postfix.conf…
2024-08-12 14:37:53 +02:00
Martin Zacho 45b7c17ba5
maintainers: add mzacho 2024-08-11 12:09:16 +02:00
Martin Zacho 91e1c5349e
nixos/modules/services/mail: add protonmail-bridge 2024-08-11 12:09:09 +02:00
Sandro Jäckel a68c330cd8
nixos/automx2: init 2024-08-09 16:42:34 +02:00
Sandro Jäckel 8bffd5f04b
nixos/mailman: configure web frontend with postfix when enablePostfix is turned on 2024-08-08 20:14:51 +02:00
Sandro Jäckel 2862350f61
nixos/postfix: allow int in config
eg. unknown_local_recipient_reject_code can be set to 550 which toString
can stringify
2024-08-05 21:18:40 +02:00
Sandro Jäckel 0bf368c8ac
nixos/mailman: allow setting relay domains with services.postfix.config.relay_domains 2024-08-05 21:15:28 +02:00
Guanran Wang ea6f4d5e86
treewide: remove periods from lib.mkEnableOption
Co-authored-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com>
2024-08-02 23:55:32 +08:00
Peder Bergebakken Sundt b2a54feb35
Merge pull request #279408 from alyssais/mailman-nginx-timeout
nixos/mailman: increase nginx proxy timeout
2024-07-19 17:56:07 +02:00
NotAShelf 48d1d14633
nixos/roundcube: adjust maxAttachmentSize, clarify documentation 2024-07-04 20:07:19 +03:00
Jonas Heinrich f45e645e92 nixos/stalwart-mail: add openFirewall option 2024-07-01 14:10:11 +02:00
Yt 6d455fee01
Merge pull request #321828 from Shawn8901/stalwart-spamfilter
stalwart-mail: include pre-defined spam-filter
2024-06-24 00:08:49 +00:00
Shawn8901 ac961ac498 nixos/stalwart-mail: set pre-defined spam-filter rules 2024-06-23 21:01:14 +02:00
euxane 8daa31600a nixos/stalwart-mail: remove deprecated {queue,report}.path settings
Since stalwart-mail 0.6.0, queue and report files are located in
the shared `storage.{data,blob}` stores. The `{queue,report}.path`
settings no longer had any effect since then.

I'm also removing the creation of the associated extra directories
in the `preStart` script. This should not cause any issue with old
setups since 0.6.0 was already packaged when 24.05 was released.
2024-06-23 11:47:12 +02:00
Linus Heckemann e5adf0b547 maintainers: drop lheckemann 2024-06-21 15:54:54 +02:00
h7x4 f5263306d8
Merge pull request #304340 from Stunkymonkey/postsrsd-chmod-install
nixos/postsrsd: prefer 'install' over 'chmod/chown'
2024-06-18 10:32:49 +02:00
Nguyễn Gia Phong 14c57ce7f7 nixos/public-inbox: make coderepo paths accessible
Fix typo in 03216e705c.
2024-06-11 19:32:59 +10:00
Jonas Heinrich 336232debd stalwart-mail: package upstream systemd unit 2024-05-31 10:22:15 +02:00
Jonas Heinrich dfa130e828 nixos/stalwart-mail: use upstream systemd unit 2024-05-31 10:20:47 +02:00
Yt 0509bb8779
Merge pull request #315908 from pacien/nixos-stalwart-default-rocksdb
nixos/stalwart-mail: rocksdb as default storage
2024-05-30 21:31:59 +00:00
Yt 782f9a832e
Merge pull request #315697 from pacien/nixos-stalwart-no-dynamicuser
nixos/stalwart-mail: do not use DynamicUser
2024-05-30 21:27:34 +00:00
euxane 0174aa1c56 nixos/stalwart-mail: rocksdb as default storage
This sets RocksDB as the default storage backend for `stateVersion` >=
24.11. For previous `stateVersion`s, the structured data and blobs
remain on SQLite and the filesystem respectively.

This is closer to the suggested upstream configuration for fully local
storage.
2024-05-30 16:22:03 +02:00
Jonas Heinrich 0ef99565a9
Merge pull request #315745 from pacien/nixos-stalwart-default-directory-db
nixos/stalwart-mail: add default account directory
2024-05-30 09:37:30 +02:00
euxane ddcbe4c369 nixos/stalwart-mail: add default account directory
This configures a default account directory for the Stalwart service.
It uses the default common database which was already configured.

Without this directory, admins could not manage users and groups using
the `stalwart-cli` tools.
2024-05-30 02:07:17 +02:00
euxane 6ee84bcda0 nixos/stalwart-mail: do not use DynamicUser
This service stores a large number of files for its blob store and some
of its databases. This is not compatible with `DynamicUser`, which
`chown`s everything in the state directory every time the service is
started. Therefore, we now use a static system user and group instead.

See https://github.com/NixOS/nixpkgs/pull/313634#discussion_r1609960417
2024-05-30 00:40:12 +02:00
euxane 824949f300 nixos/stalwart-mail: migrate logging config
The logging configuration keys have changed,
which caused this config to be ignored.
2024-05-29 22:17:59 +02:00
Jonas Heinrich 50388b71cc nixos/stalwart-mail: add onny as maintainer 2024-05-24 12:26:13 +02:00
Jonas Heinrich 3d6a20f380 nixos/stalwart-mail: drop legacy package 2024-05-24 12:15:50 +02:00
Jonas Heinrich 2c4128ea01 nixos/stalwart-mail: use publicsuffix-list package
Co-authored-by: shawn8901 <shawn8901@googlemail.com>
2024-05-21 21:09:38 +02:00
Jonas Heinrich 1f4329cde6 nixos/stalwart-mail: pin module to package version 0.6 2024-05-19 14:17:31 +02:00
euxane f4c5060ecc nixos/stalwart-mail: set default lookup storage
This configuration key is now required.
The shared default DB is a good default.
2024-05-15 00:42:08 +02:00
Felix Buehler a181e098c9 nixos/mailman: prefer 'install' over 'chmod/chown' 2024-04-30 22:51:40 +02:00
Maximilian Bosch e59f7ab9ef
Merge pull request #278152 from ckiee/roundcube-fix-postgresql-package-ref
nixos/roundcube: eliminate extra postgres package for local databases
2024-04-24 21:33:54 +00:00
ckie bdde259862
nixos/roundcube: eliminate extra postgres package for local databases 2024-04-24 22:45:37 +03:00
Maximilian Bosch 7bb471b3e8
nixos/roundcube: use php 8.3
Upstream claims that 1.6 works fine with PHP 8.3[1]. Also PHP 8.1 is in
the security-only phase already, so we'll need to change sooner or later
anyways.

[1] https://github.com/roundcube/roundcubemail/issues/9339
2024-04-21 23:18:41 +02:00
Felix Buehler e9570410a1 nixos/postsrsd: prefer 'install' over 'chmod/chown' 2024-04-15 20:41:44 +02:00
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Bjørn Forsman a29010fe79 nixos: improve many 'enable' descriptions 2024-04-09 07:10:17 +02:00
Janne Heß bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
Marcel 896a4d62d8
listmonk: ensure correct application of data migration 2024-03-01 10:45:12 +01:00
Manuel Stahl cd8aad903c stalwart-mail: fix default configuration and test 2024-02-13 20:34:22 +01:00
Marco Rebhan 522d660f25
nixos/dovecot: fix sieve script config generation 2024-01-29 19:42:55 +01:00
Marco Rebhan 26e71b5a5b
nixos/dovecot: remove unused imports 2024-01-29 12:21:58 +01:00
Lassulus da25b2382d
Merge pull request #280373 from h7x4/treewide-use-new-tmpfiles-api
treewide: use new tmpfiles API
2024-01-26 10:47:18 +01:00
Raito Bezarius 3cb7823738 nixos/mail/dovecot2: warn about potential collision due to structured configuration
Plugin configuration is pesky in dovecot2, let's warn about potential conflicts
in the module system by using a fancy regex.

This is only band-aid, this should be removed ASAP.

We clean up also a 21.05-era warning.
2024-01-25 17:18:58 +01:00
h7x4 f5d513c573
treewide: use new tmpfiles api 2024-01-24 05:13:17 +01:00
Raito Bezarius 72e23635e6 nixos/mail/dovecot2: imapsieve.mailbox.*.causes is a list
Otherwise, it's not possible to pass `COPY,APPEND` properly.
2024-01-23 14:04:08 +01:00
Raito Bezarius caf9e51e0f nixos/mail/dovecot2: re-introduce extra settings and rename sieveScripts
https://github.com/NixOS/nixpkgs/pull/275031 introduced structured configuration
for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations.

This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
2024-01-23 14:04:08 +01:00
Robert Schütz 6de0d9293e
Revert "Dovecot: Do not include empty sieve_extensions and sieve_global_extensions" 2024-01-22 10:02:51 -08:00
Kevin Cox 9cd3bd7a5c
Merge pull request #281915 from exi/patch-1
Dovecot: Do not include empty sieve_extensions and sieve_global_extensions
2024-01-20 09:10:41 -05:00
Jade Lovelace fe474ed61a nixos: fix remaining services for network-online dep fix 2024-01-19 00:11:34 -08:00
Reno Reckling 33ede4cc7c
use concatMapStringsSep in dovecot config
Co-authored-by: h7x4 <h7x4@nani.wtf>
2024-01-19 07:14:59 +01:00
Reno Reckling 1e4065d90a
Do not include sieve_extensions and sieve_global_extensions if they are the default value
Setting them to empty string will disable the default behaviour, leading to missing extensions.
2024-01-19 01:21:07 +01:00
Ryan Lahfa bbd92ae047
Merge pull request #280561 from RaitoBezarius/fix-listmonk-module
nixos/mail/listmonk: fix hardening directives
2024-01-17 03:42:31 +01:00
Maximilian Bosch 7f91c8ef83
Merge pull request #276496 from Izorkin/update-roundcube-nginx
nixos/roundcube: update nginx configuration
2024-01-16 20:40:12 +01:00
Nick Cao 2443ba38b6
Merge pull request #272910 from SuperSandro2000/nullmailer
nixos/nullmailer: be flexible about time related types
2024-01-14 14:23:28 -05:00
Raito Bezarius 4c84c9c1c3 nixos/mail/listmonk: fix hardening directives
For some reason, I don't know why I missed those, but
I didn't look at my logs for a while.

It would be nice if we could catch those statically kinda (?) in CI.
2024-01-12 20:14:52 +01:00
Ryan Lahfa 1b2aeec40a
Merge pull request #275031 from 2xsaiko/outgoing/sieve
nixos/dovecot: add support for sieve extensions, in particular imapsieve and pipe
2024-01-12 20:05:45 +01:00
Alyssa Ross 4481ce601f
nixos/mailman: increase nginx proxy timeout
In my experience, just after boot, the default timeout of 60 seconds
often isn't quite enough for Mailman.  It's better for the user to
have the request take a little longer than it is to 504.
2024-01-07 16:56:10 +01:00
Guillaume Girol 17fc67eb2e
Merge pull request #255464 from georgyo/postfix-dont-use-file-ownership
nixos/postfix: postalias should not use source file permissions
2023-12-31 15:20:48 +01:00
Izorkin 7ead602f93
nixos/roundcube: add configureNginx option 2023-12-30 15:01:13 +03:00
Izorkin 3b74d8781f
nixos/roundcube: update nginx configuration 2023-12-30 15:01:12 +03:00
Jonas Heinrich 80d88736da nixos/rspamd-trainer: init; rspamd-trainer: init at unstable-2023-11-27 2023-12-27 10:35:53 +01:00
Nick Cao a83ee8f514
Merge pull request #255227 from tomfitzhenry/postfix-harden
nixos/postfix: add systemd hardening directives
2023-12-23 10:36:18 -05:00
Marco Rebhan 7004ee65c2
nixos/dovecot: add myself as maintainer 2023-12-21 12:41:08 +01:00
Marco Rebhan 1e31a631b7
nixos/dovecot: add support for sieve extensions, in particular imapsieve and pipe 2023-12-21 12:41:08 +01:00
Sandro Jäckel b3b09c5eb2
nixos/nullmailer: be flexible about time related types 2023-12-08 14:59:28 +01:00
Emily Trau 7edd128431
Merge pull request #266746 from serpent213/patch-2
nixos/roundcube: Ignore newline at end of password file
2023-12-01 15:50:05 +11:00
h7x4 79d3d59f58
treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Ryan Lahfa ccfe07c316
Merge pull request #266270 from Ma27/postgresql-ownership-15 2023-11-17 18:02:17 +01:00
Maximilian Bosch 48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00
Molly Miller 9cec5c807a nixos/mailman: restart services on failure and increase mailman timeouts 2023-11-13 16:10:55 +01:00
Steffen Beyer ae5fe741ba
nixos/roundcube: Ignore newline at end of password file 2023-11-11 00:17:53 +01:00
Linus Heckemann 8670794565
Merge pull request #263203 from nikstur/replace-activation
Replace simple activationScripts
2023-10-28 10:17:15 +02:00
nikstur f18ff2ec0b nixos/mlmmj: replace activationScript 2023-10-26 01:44:21 +02:00
github-actions[bot] cfc75eec46
Merge master into staging-next 2023-10-20 18:00:54 +00:00
Vladimír Čunát 9320d9e7bc
Merge #260527: Mailman fixes
...into staging-next
2023-10-20 18:56:03 +02:00
Bjørn Forsman 142074c2a8 nixos: fix bad mkEnableOption descriptions
Fix descriptions that don't account for (1) the "Whether to enable"
prefix or (2) the automatically added trailing dot.
2023-10-20 16:22:40 +01:00
Maximilian Bosch 2ee12a93de treewide: remove myself (ma27) from a few packages
It's time again, I guess :>

Main motivation is to stop being pinged about software that I maintained
for work now that I'm about to switch jobs. There's no point in pinging
me to review/test updates or to debug issues in e.g. the Atlassian stack
or on mailman since I use neither personally.

But there's also a bunch of other stuff that I stopped using personally. While
at it I realized that I'm still maintainer of a few tests & modules related to
packages I stopped maintaining in the past already.
2023-10-18 15:47:20 -03:00
Molly Miller 1a794a3e4b nixos/mailman: store locks in ephemeral runtime directory
nixosTests.mailman: test mailman master lock handling
2023-10-12 10:39:18 +00:00
Alyssa Ross 21e3908ea3
nixos/mailman: ensure uwsgi uses mailman's python
If they differ, uwsgi will fail to start, because it won't be able to
find the appropriate libraries.
2023-10-11 20:20:12 +00:00
George Shammas 142d83f90e
nixos/postfix: postalias should not use source file permissions
Our postfix-setup service ensures that the directory is only writable by root.

postalias by default drops permissions to the user of the source file. In the
case of NixOS that file is in the nix store and thus always owned by root and
everything works.

The problem is that when using a nixos-container with user namespaces (`-U`)
then the nix store is owned by nobody/nogroup, and postfix-setup.service will be
unable to create or modify `aliases.db`.

Since the file would otherwise be owned by root, we should tell postfix to not
assume the user and permissions of the `aliases` file by setting -o and -p

From postalias(1)

> -o Do not release root privileges when processing a non-root input file. By
> default, postalias(1) drops root privileges and runs as the source file owner
> instead.

> -p Do not inherit the file access permissions from the input file when
> creating a new file. Instead, create a new file with default access
> permissions (mode 0644).
2023-09-16 08:22:45 -04:00
Tom Fitzhenry dd1b3b077a nixos/postfix: add systemd hardening directives
Inspired by
a9ccc48242/mail-mta/postfix/files/postfix.service

This decreases the systemd-analyze exposure level from UNSAFE to MEDIUM:

```
$ systemd-analyze security --offline=true postfix-hardened.service | grep Overall
→ Overall exposure level for postfix-hardened.service: 6.2 MEDIUM 😐

$ systemd-analyze security --offline=true postfix-original.service | grep Overall
→ Overall exposure level for postfix-original.service: 9.6 UNSAFE 😨
```
2023-09-16 06:37:00 +10:00
revol-xut 6f50091de7 nixos/listmonk: fixing datatype of options 2023-09-09 15:21:32 +02:00
BruNeu c729c9746e nixos/stalwart-mail: fixed broken link 2023-09-08 23:59:03 +02:00
pacien f6961de637 nixos/stalwart-mail: add module 2023-09-03 22:18:50 -04:00