* 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
* chore: install swaks from the Debian package
Debian Trixie ships the same upstream version (20240103.0) that was
downloaded from the GitHub release, so the download is no longer needed
and the package receives updates from Debian.
* docs(changelog): link the pull request
---------
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
* fix(build): use Debian's Dovecot config layout with the CE packages
The Dovecot CE repo ships a minimal config layout that DMS does not
expect: no 15-lda.conf, 90-fts.conf or 20-pop3.conf, a 2.3-style
20-managesieve.conf, and a dovecot.conf without the commented
protocols/listen lines or the local.conf include. The startup scripts
then fail to enable LMTP, so Postfix cannot deliver to Dovecot, and a
custom dovecot.cf is ignored.
When DOVECOT_COMMUNITY_REPO=1, install the config files from Debian's
own packages of the same release, as Debian's postinst does. Also
tolerate the missing 90-fts-flatcurve.conf, which only Debian ships,
as the build otherwise fails.
* fix(build): install ssl-cert explicitly
Dovecot and Postfix default to the snakeoil cert from the ssl-cert
package. Debian's dovecot-core depends on ssl-cert, but the Dovecot CE
package does not, so with DOVECOT_COMMUNITY_REPO=1 the cert is missing
and Dovecot fails to start when no SSL_TYPE is set.
* fix(dovecot): disable attachment detection keywords explicitly
Dovecot 2.4.2 changed the default of mail_attachment_detection_options
to add-flags for maildir and dbox. This per-driver default is applied
even with dovecot_config_version = 2.4.0, so LMTP adds a
$HasNoAttachment keyword and maildir stores new mail in cur/ instead of
new/. Set it explicitly to keep the 2.4.0/2.4.1 behaviour. This is a
no-op with Debian's Dovecot 2.4.1.
* tests: make the letsencrypt doveconf check work with Dovecot 2.4.2+
Querying `doveconf ssl_server` prints nothing with Dovecot 2.4.5, and
querying the full setting names prints empty values with 2.4.1. Use
`doveconf -n -P`, which prints the same lines on both.
* docs: add changelog entries for the Dovecot CE build fixes
* docs: link the changelog entries to #4834
* fix(build): exclude the CE repo instead of matching deb.debian.org
Matching the deb.debian.org host made builds behind a different Debian
mirror (Artifactory, apt-cacher-ng, regional mirrors) fail to find the
Debian version of dovecot-core. There are only two sources, so exclude
repo.dovecot.org instead.
* docs: describe the attachment detection setting as a deliberate choice
Mail in cur/ without the S flag is still valid maildir and still
unread, so the explicit empty value is for parity with the Debian
build, not a bug fix. Say so in the config comment and the changelog,
and mention how to enable the feature.
---------
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
* fix(rspamd): pin Rspamd to 4.1.5 and install it from a verified .deb
The Rspamd apt repo only lists the newest release, so every image build
and rebuild picked up whatever Rspamd had just released. Download the
pinned release from the repo's pool instead and verify its sha256 for
amd64 and arm64. 4.1.5 is the version in Debian testing (forky).
* docs(changelog): link the pull request
* chore: bump `jaq` from 2.3.0 to 3.0.0
* chore: bump `step-cli` from 0.28.7 to 0.30.2
* chore: formatting
---------
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Changes:
- `jaq` should probably live in `/usr/local/bin` with other third-party sourced binaries.
- `swaks` install properly with just `tar`, no `mv` + `rm` needed.
- Added Smallstep `step` CLI. This serves similar purpose to `openssl` commands, but is generally nicer for usage with generation and inspection of certs/keys. I've talked up using in DMS a few times in the past for our TLS helper and unifying DKIM support (_instead of separate OpenDKIM/Rspamd generators_).
- Including `step` for both AMD64 / ARM64 archs needs the alternate naming convention that it's published to GH releases with.
- Added commentary about the `tar` usage. The ownership is a common concern with GH release sources, technically a non-issue when running as `root`
- Bump to [`jaq` v2 release](https://github.com/01mf02/jaq/releases/tag/v2.0.0), artifact naming convention changed.
- Tidied up the changelog a little bit unrelated to this `jaq` update.
- Fixed a typo with an `rspamd.sh` comment + minor revision to the comment.
* fix: Update `dovecot-fts-xapian` to `1.7.13`
Contains a fix to a regression introduced that broke indexing
---------
Co-authored-by: casperklein <casperklein@users.noreply.github.com>
* update `compile.sh` and Dovecot FTS Xapian to 1.7.12
- I updated from 1.5.5. Moreover, I adjusted the script to have what I
consider better style.
* update Dockerfile to use recent updates
* update CHANGELOG
* feat: add support for MTA-STS for outgoing mails
* Hook-up mta-sts-daemon into basic process handling test
* fix: Call python script directly
The python3 shebang will run it, which will now meet the expectations of the process testing via pgrep. fail2ban has the same approach.
---------
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
* scripts: Install rspamd from official repository instead of debian backports on arm64 architecture
* Remove unnecessary deb-src repository for rspamd
* Remove note about ARM64 rspamd version, update CHANGELOG.md
---------
Co-authored-by: Peter Adam <p.adam@cygnusnetworks.de>
* fix: Source `VERSION` from image ENV
Now CI builds triggered from tagged releases will always have the correct version. No need for manually updating a separate file.
* fix: Query latest GH release tag
Compare to the remote GH release tag published, rather than contents of a `VERSION` file.
`VERSION` file remains in source for now as prior releases still rely on it for an update notification.
* chore: Switch from `yq` to `jaq`
- Can more easily express a string subslice.
- Lighter weight: 9.3M vs 1.7M.
- Drawback, no YAML input/output support.
If `yq` is preferred, the `v` prefix could be removed via BASH easily enough.
* chore: Add entry to `CHANGELOG.md`
* ci: `VERSION` has no relevance to `:edge`
* docs: Update build guide + simplify `make build`
---------
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
* Dovecot: add deb package dovecot-lua to support Lua scripting
* Adding documentation for Lua authentication
* Updated documentation and made a better distinction between Dovecot packages for officially supported features and for community supported features.
---------
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>