398 Commits
Author SHA1 Message Date
Alan SavageandGeorg Lauterbach 626d893992 chore: install swaks from the Debian package (#4837)
* 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>
2026-11-05 22:51:07 +01:00
Chris FunderburgandGeorg Lauterbach 98b6a5b86c fix: dovecot CE builds for 2.4 (#4834)
* 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>
2026-11-05 22:47:12 +01:00
Alan Savage bd8b31397a fix(rspamd): pin Rspamd to 4.1.5 and install it from a verified .deb (#4836)
* 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
2026-11-05 22:34:48 +01:00
Georg Lauterbach d899d769c7 fix(scripts): move CHANGELOG_URL so that LATEST is set
in update check script

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-10-25 11:46:02 +01:00
Ask Bjørn Hansen d705e50081 fix: randomize the freshclam cron schedule (#4824) 2026-10-19 00:37:46 +02:00
Brennan KinneyandGeorg Lauterbach 45ae8a4c32 breaking: Generate Postfix LDAP configs from layered sources (#3524)
Postfix LDAP configs are now generated at startup to `/etc/postfix/ldap/<KIND>.cf`
(`users`, `groups`, `aliases`, `domains`, `senders`) from these sources, later ones take precedence:

1. Defaults (`version = 3`, `result_attribute = mail`, `senders`: `mail, uid`).
2. `LDAP_<SETTING>` ENV for all configs.
3. The custom config `ldap-<KIND>.cf` from the DMS config volume (now also supported for `senders`).
4. `POSTFIX_<KIND>_<SETTING>` ENV for a single config.

A config without `query_filter` is not generated and its lookup table is not configured
(including `smtpd_sender_login_maps` with `SPOOF_PROTECTION=1`). Previously all lookup
tables were always configured, as the default configs shipped by the image always existed.

Breaking:
- `LDAP_QUERY_FILTER_{USER,GROUP,ALIAS,DOMAIN,SENDERS}` are renamed to
  `POSTFIX_{USERS,GROUPS,ALIASES,DOMAINS,SENDERS}_QUERY_FILTER` (an error is logged when the old ENV is set).
- `/etc/postfix/ldap-*.cf` moved to `/etc/postfix/ldap/*.cf`, the default configs (with default query filters) were removed.

Reworked from the original "Config Templates" proposal: Dovecot (already reworked for Dovecot 2.4)
and SASLAuthd are unchanged, and no template files or additional dependencies (`zenv`, `envsubst`) are required.

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-10-17 18:49:36 +02:00
e4907e15bc refactor: Helper function _replace_by_env_in_file() (#3526)
* fix: Helper `_replace_by_env_in_file()` support delimiter parameter

Minor change to add support for usage with `saslauthd.conf` which differs with `:` for it's key/value delimiter.

Also adopts the`_escape_for_sed()` method, instead of the inline sed pattern (_which for some reason escaped `=` but not `(` + `)`, thus buggy if ever matching on input with those tokens_).

`_escape_for_sed()` likewise wasn't escaping for `(` + `)` or even `|`, which are required for proper escape support if using `sed -E` / `sed -r` with this method. Additionally added escaping support for `&` replacement segment token, which seems valid. Increased verbosity to better grok pattern matching expression, clarified escaping concern with `sed` delimiter since the project is not consistent there.

* chore: Preserve K/V white-space of original source

No need to check for a non-empty value to prepend a space (_since an empty value is used via sed anyway?_).

Can also be a bit DRY with the sed pattern, matching the key + delimiter (_and all white-space before/after the delimiter until the value_), then capture that for the replacement left-side value while only actually swapping the value for the ENV input value.

Should be an improvement, unless there is a scenario that would differ between `` and ` ` as valid value assignments?

* chore: Adopt `sedfile` + case-insensitive pattern matching

Both should be improvements for usage

Co-authored-by: Casper <casperklein@users.noreply.github.com>

* fix: Harden `_replace_by_env_in_file()` and update tests

- Split each ENV line at the first `=` only, `IFS='=' read` dropped a trailing `=` from values (e.g. base64 padded passwords).
- Use `/` as the `sed` delimiter, as it is the only delimiter escaped by `_escape_for_sed()` (values with `#` broke the expression).
- Revert `sedfile` to `sed -i`: most prefixed ENV have no matching key, so an unchanged file is expected and `sedfile` would log spurious errors.
- Drop the unused key/value delimiter parameter.
- Avoid trailing white-space when the value is empty.
- Tests: Expect the retained white-space, add edge-cases for `sed` tokens and a trailing `=`, compare LDAP settings white-space insensitive.

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>

---------

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-10-17 18:29:54 +02:00
893454258b feat: add IMAP IDLE support for getmail (#4675)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brainkiller <brainkiller@boven.xyz>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-10-04 22:40:14 +02:00
mainboarderandGeorg Lauterbach deb1cb084f fix: wrong changelog link (#4813)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-10-04 22:34:00 +02:00
Georg Lauterbach c8a7dd08ad fix(rspamd): only migrate Redis if the version can be migrated
Valkey does not understand RDB version 12, hence we cannot always easily
migrate.

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-09-28 10:21:56 +02:00
Georg Lauterbach 46206aeb89 feat: replace Redis with Valkey (#4808) 2026-09-25 21:56:46 +02:00
Georg Lauterbach 198ccc8f8a feat: re-enable Dovecot's stats-writer (#4807)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-09-25 17:12:02 +02:00
Copilotandgeorglauterbach 6ad4401356 fix(tls): preserve Postfix overrides during runtime SSL refresh (#4806)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-09-25 16:51:45 +02:00
Georg Lauterbach 1fb93044c2 feat: remove Xapian (#4786) 2026-09-05 18:55:50 +02:00
beertje44 9aa9366bcb feat: add dovecot-solr (again) (#4782)
Restored default inclusion of dovecot-solr and updated related tutorial. Adjusted Dovecot LDAP configurations and improved permission repair process.
2026-09-04 11:40:11 +02:00
Georg Lauterbach a3276b0fdf fix: update Dovecot LDAP configuration (#4770)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-31 12:07:40 +02:00
089d65f2d2 fix: update permissions check to invoke chown directly on returned paths of find (#4696)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: neil <neil@noreply.example.org>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-30 18:12:08 +02:00
Georg Lauterbach ad0e23f2c0 release: v16.0.0 (#4761)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-30 11:39:56 +02:00
Georg Lauterbach 9e3d15391e chore: remove default Dovecot Flatcurve configuration file (#4760)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-28 17:31:35 +02:00
Georg Lauterbach 2f3a5314f0 feat: add dovecot-flatcurve to installed packages (#4759)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-28 14:31:01 +02:00
Georg Lauterbach 7445d9d7c8 chore: update Fail2Ban to 1.1.1 (#4755)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2026-08-28 12:58:14 +02:00
Georg LauterbachandBrennan Kinney c41d2de2be remove: Diffie-Hellman parameters for Postfix & Dovecot (#4562)
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2026-08-28 10:30:31 +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
Brennan Kinney dacec800f7 fix: Write ENABLE_MTA_STS to /etc/dms-settings (#4707) 2026-05-24 14:21:45 +02:00
Andreas Perhab cb76075f25 fix: Dockerfile - Build dovecot-fts-xapian package from debian sources (#4700) 2026-05-01 19:30:50 +02:00
Georg Lauterbach a1d1160361 chore: update tools we fetch from GitHub (#4692)
* 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>
2026-04-04 19:53:21 +02:00
Georg Lauterbach b81e2b526f fix: remove expand_keys = true from Rspamd configuration (#4689) 2026-03-28 20:22:51 +01:00
1caedc0a40 chore: Improve clarity of SSL_TYPE=self-signed error message (missing files) (#4658)
Removed ambiguity when an expected file to support this `SSL_TYPE` mode was missing. The error message is now dynamic so that it only displays what is missing, along with language that is more compatible to one vs multiple files.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2026-02-17 11:09:05 +13:00
066d314264 fix: Reload the rspamd service instead of restarting it (#4632)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Cristian Spiridon <scristian71@gmail.com>
2026-01-12 09:08:59 +13:00
FDHoho007 17111a0ea2 fix: LDAP - Enable check-for-changes.sh support (#4627)
* fix: Enable change detection support for `ACCOUNT_PROVISIONER=LDAP`
* fix(test/rspamd_full): Explicitly wait for the `rspamd_proxy` port to be available before testing
2025-12-27 12:15:28 +13:00
Brennan Kinney e5185e0e84 fix: accounts.sh - Support first valid local account (#4581)
- Ensure catch-all alias entries (eg: `@example.test`) are also skipped. Adding a dummy account for catch-all will not match a `quota-status` query to Dovecot by Postfix for a recipient.
- When there are multiple addresses provided, they will now be iterated through by the `,` delimiter, instead of as a single value that fails. This way the first valid aliased address to a local Dovecot mailbox account will now be used for the dummy alias account.
- The common logic for extracting the quota user attribute is now split out to a common function call.
2025-10-08 19:58:49 +00:00
Brennan Kinney 5e5e005162 chore: Revise inline docs for Fetchmail (#4587) 2025-10-08 10:33:26 +13:00
Lars K.W. Gohlke 9eb3fa73e5 fix: Prevent logs leaking into config files (FETCHMAIL_PARALLEL=1) (#4586) 2025-10-06 20:25:13 +02:00
lalalalaandGeorg Lauterbach f343f7d960 fix RSPAMD_LEARN with mbsync (#4569)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2025-09-11 19:03:01 +02:00
Georg LauterbachandBrennan Kinney c1da4265d3 chore: apt - Migrate format from .list to .sources (DEB822) (#4556)
* chore: switch to `.sources` layout from `.list`

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>

* chore: update CHANGELOG

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>

* Apply suggestions from code review

---------

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2025-08-18 12:45:20 +12:00
Georg Lauterbach 9e4749e718 chore: update externally installed software (#4557) 2025-08-17 13:20:21 +02:00
Georg Lauterbach da61eb21a3 chore: Remove Pyzor + Razor packages (#4548) 2025-08-17 11:00:01 +02:00
Jam BalayaandGeorg Lauterbach c1a5eabc94 chore: fix various typos across codebase (#4552)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2025-08-12 21:55:53 +00: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 8fa6e6deba chore: Avoid logging a warning when LOG_LEVEL is unset (#4497) 2025-06-02 17:01:00 +12:00
Brennan Kinney ea03808c8f fix: packages.sh - Remove Postfix hostname workaround (#4493) 2025-05-27 23:03:10 +02:00
Brennan Kinney f6381d3bb0 fix: Ensure DMS config volume can be accessed by non-root users (#4487) 2025-05-23 16:05:20 +12:00
Brennan Kinney a0e0013260 chore: Typo fix for debug log (#4480) 2025-05-21 11:50:05 +12:00
53c36194d9 feat: Enable reading env vars from files (#4359)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2025-05-17 23:37:43 +02:00
Brennan KinneyandGeorg Lauterbach 491c30b194 fix: setup email list should only work with ACCOUNT_PROVISIONER=FILE (#4453)
---------

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2025-04-25 10:06:35 +12:00
f2e5891b16 feat: Configurable poll rate for check-for-changes.sh (#4450)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2025-04-23 18:43:41 +02:00
23bb1c8e50 refactor: setup CLI open-dkim (#4375)
Refactoring this `setup` CLI command as part of the effort to unify our DKIM feature support between OpenDKIM + Rspamd:
- Adds a `main()` method similar to other setup CLI commands.
- Help text more aligned with equivalent rspamd DKIM setup CLI command.
- DRY some repetition such as hard-coded paths to use variables.
- OpenDKIM config files are created / initialized early on now with `_create_opendkim_configs()`. `while` loop only needs to append entries, so is easier to grok.
- `_create_dkim_key()` to scope just the logic (_and additional notes_) to key generation via `opendkim-genkey`
- Now overall logic with the `while` loop of the script occurs in `_generate_dkim_keys()`:
  - Ownership fixes are now applied after the `while` loop as that seems more appropriate than per iteration.
  - Temporary VHOST config is now removed since it's no longer useful after running.
- Tests adjusted for one new log for adding of default trusted hosts content.

Overall this should be nicer to grok/maintain. Some of this logic will be reused for the unified DKIM generation command in future, which is more likely to shift towards all domains using the same keypair by default with rspamd/opendkim config generated at runtime rather than reliant upon DMS config volume to provide that (_still expected for private key_).

---------

Co-authored-by: Casper <casperklein@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2025-03-31 11:27:28 +02:00
Brennan Kinney a3571a88c1 fix: DMS state volume must ensure o+x permission (#4420) 2025-03-18 23:48:12 +01:00
Georg Lauterbach 0362fa682e fix: include all files in change detection of Rspamd (#4418) 2025-03-18 00:08:14 +01:00
Brennan Kinney 7c680a0fbc fix: start-mailserver.sh requires mail_state.sh to be sourced on restarts (#4417) 2025-03-16 15:34:51 +01:00