28 Commits
Author SHA1 Message Date
Georg Lauterbach 79b66c8b89 config(dovecot)!: ship a self-reliant configuration (#4861)
* breaking(dovecot): ship a self-reliant Dovecot configuration

DMS imported the config files of Debian's Dovecot package at build time
and patched them with `sed` at startup. For the Dovecot Community Edition
(CE) it even downloaded Debian's packages only to extract their config.
The result depended on whatever the packages shipped, and every feature
toggle was an `!include` line that a script had to comment or uncomment.

Provide the complete configuration in the repository instead:

- `target/dovecot/dovecot.conf` replaces the `10-*`, `15-*`, `20-*` and
  `90-*` files as well as the `*.inc` files. Everything that is not set
  there uses Dovecot's built-in defaults.
- `target/dovecot/features/` holds the optional parts (passwd-file, LDAP
  and OAuth2 authentication, quotas, Rspamd learning). Startup copies the
  ones that are enabled into the empty `/etc/dovecot/conf.d/`, which
  `dovecot.conf` includes before `local.conf` (`dovecot.cf`).
- The scripts only substitute ENV-derived values now; the include
  toggling and the second `sed` per feature are gone.
- Drop the Debian config import and the CE-only download from the build.

Breaking: files that users replaced, bind-mounted or patched in
`/etc/dovecot/conf.d/` no longer exist (see the changelog for the
mapping). Debian's deprecated ManageSieve listener on port 2000 and its
`fts_autoindex*` defaults are gone as well.

Add tests for the removed port 2000 and for a valid `doveconf -n` with the
protocols enabled according to ENV, and adjust the existing tests and
fixtures to the new file layout. Rewrite the Dovecot override docs.

Closes #4841

* fix(dovecot): load enabled features before user supplied config

Features that DMS enables were copied to `conf.d/`, so Dovecot read them
in file name order together with user drop-ins. A user file such as
`90-custom.conf` was read before `quota.conf` or `auth-ldap.conf`, and the
feature silently overrode the user's settings.

- copy enabled features to `/etc/dovecot/features.d/` instead, which
  `dovecot.conf` includes before `conf.d/*.conf`
- include the master user passdb before `conf.d/*.conf` as well, so a
  drop-in can override `auth_master_user_separator`
- create `features.d/auth-ldap.conf` with mode 640 (group `dovecot`), as
  it contains the LDAP bind password
- link the changelog entries to the PR, document the always-active master
  passdb, and adjust docs and tests to the new layout
- test that a `conf.d/` file overrides the quota feature, and that
  `auth-ldap.conf` is not world-readable
2026-11-18 17:59:30 +01:00
Georg Lauterbach 9bcd3e1db9 fix(dovecot): run all scripts in the global Sieve before/after directories
Since the Dovecot 2.4 migration, DMS registered one `sieve_script` block
per script it generates. Any other script placed in
`/usr/lib/dovecot/sieve-global/{before,after}/` (e.g. via
`user-patches.sh`) compiled but was silently ignored, unlike up to v15
where `sieve_before` / `sieve_after` pointed at the directories.

Register both directories as `before` / `after` script storages in
`90-sieve.conf` instead. Pigeonhole runs every `*.sieve` file in them in
file name order, which matches the previous execution order of the
scripts DMS generates itself (`50-`, `60-` and `70-` prefixes). The
per-file `sieve_script` blocks are removed.

- docs: describe the drop-in directories in the Sieve page
- tests: add a regression test with a script added via `user-patches.sh`
- changelog: add a `Fixed` entry with upgrade notes

Closes #4847
2026-11-11 14:48:17 +01:00
Ask Bjørn Hansen d705e50081 fix: randomize the freshclam cron schedule (#4824) 2026-10-19 00:37:46 +02:00
Georg LauterbachandBrennan Kinney c9b015ddc8 chore: update base image from Debian 12 to Debian 13 (#4536)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2026-08-19 22:32:02 +02:00
Ivan FilonenkoandCasper fcd9909841 fix(fail2ban): configure logrotate only when Fail2Ban is enabled (#4523)
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2025-07-11 17:02:42 +02:00
Brennan Kinney d2d74a29a7 fix: Ensure /var/log/mail permissions + ownership are correct (#4374) 2025-02-18 09:02:35 +13:00
Casper 3125cad45a Enable spamassassin only, when amavis is enabled too. (#3943) 2024-03-21 00:53:04 +01:00
Kirill KirilenkoandBrennan Kinney 3649699197 fix: Move spam to mailbox associated to the \Junk special-use attribute (#3925)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-03-07 11:13:22 +13:00
Casper 83a48e8958 Fail2ban logrotate interval/count: substitute only when necessary (#3919) 2024-03-03 22:48:42 +01:00
Casper 736f2e44bc Fail2Ban: Align logrotate count & interval (#3915) 2024-03-01 01:00:23 +01:00
Georg Lauterbach afb0093939 spam: use Sieve for rewriting subject with Rspamd & SA/Amavis (#3820) 2024-01-29 13:38:01 +01:00
00018e7e2b general: update base image to Debian 12 ("Bookworm") (#3403)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2024-01-24 17:05:55 +01:00
Brennan Kinney 2d59aac5a1 chore: Add maintenance comment for sed usage (#3789)
This is a more explicit reminder for any future contributors that get thrown off by the usage of `sed` here and may be inclined to change it.

Add a link to reference a comment where it's already been explored what the alternative `sed` invocations available are.
2024-01-17 20:54:27 +13:00
Brennan Kinney 5e28c17cf4 docs: SpamAssassin ENV docs refactor (#3756)
* chore: Log `SPAMASSASSIN_SPAM_TO_INBOX=1` ENV correctly

ENV name logged was incomplete.

* docs: Update SA related ENV docs

* fix: Log level `warning` should be `warn`

* docs: FAQ - Revise outdated SA entry

* chore: Antispam / Antivirus => Anti-spam / Anti-virus

* docs: ENV - Additional revisions to SA ENV

* docs: ENV - Move `ENABLE_SPAMASSASSIN_KAM`
2024-01-08 03:07:38 +01:00
H4R0andBrennan Kinney bb2038e8c6 feat: Allow marking spam as read via a sieve filter (ENV MARK_SPAM_AS_READ=1) (#3489)
* add MARK_SPAM_AS_READ environment variable

* review changes

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>

* update unit test

---------

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2023-08-21 10:32:26 +12:00
Claude Brisson 2b400a9269 Fix sieve setup (#3397) 2023-06-20 13:37:31 +02:00
Casper 8bfe8424fc Change 'for' style (#3368) 2023-05-26 14:00:40 +02:00
Casper 37ca0f9ba9 Change 'function' style (#3364) 2023-05-26 01:01:41 +02:00
Casper cf74127f78 change if style (#3361) 2023-05-24 09:06:59 +02:00
Casper 0e592aa911 SPAM_TO_INBOX=1; add info about SA_KILL (#3360) 2023-05-23 19:32:09 +02:00
Casper a72adc2731 Fix typos (#3344) 2023-05-15 19:11:36 +02:00
Andreas Perhab ec330a35a1 ClamAV: add a warning for the internal message size limit (#3341) 2023-05-15 15:46:13 +02:00
Georg Lauterbach 78b7f0cbea scripts: improve CLAMAV_MESSAGE_SIZE_LIMIT usage (#3332)
* add sanity check for Clam size & adjusted MaxScanSize

The second part is of special importance! See
<https://askubuntu.com/a/1448525>, which explains that the maximum scan
size is important as well. We previously just set the maximum file size,
which actually is pretty insecure as we silently not scan mile bigger
than `MaxScanSize`. This is corrected now.

* add SlamAV size configuration to Rspamd
2023-05-12 16:04:41 +02:00
Georg Lauterbach 88cd244e47 scripts: misc improvements (#3281)
* corrected typo
* corrected indentation
2023-04-23 12:16:53 +02:00
Georg Lauterbach e58dd1b95b Rspamd: more features (#3159) 2023-03-18 23:32:48 +08:00
Georg Lauterbach 8ec5dbec74 scripts: touchups for v12.0.0 (#3144) 2023-03-04 10:57:42 +01:00
Georg Lauterbach 4b04c3e31c scripts: housekeeping & cleanup setup (1/2) (#3121) 2023-02-27 20:21:45 +01:00
Georg Lauterbach f35b60042f scripts: split setup-stack.sh (#3115) 2023-02-26 11:42:14 +01:00