From 2c602299136fcac8a8fd02ada86039687e6ae18c Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sun, 26 Nov 2023 20:15:14 +0100
Subject: [PATCH 1/5] docs: updated `CONTRIBUTORS.md` (#3656)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
---
CONTRIBUTORS.md | 115 +++++++++++++++++++++++++-----------------------
1 file changed, 61 insertions(+), 54 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 893b9572733..46e0523f084 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1180,6 +1180,13 @@ Thanks goes to these wonderful people ✨
jcalfee
+
+
+
+
+ mivek
+
+ |
@@ -1200,15 +1207,15 @@ Thanks goes to these wonderful people ✨
JiLleON
- |
+
+
jirislav
- |
-
+
@@ -1243,15 +1250,15 @@ Thanks goes to these wonderful people ✨
akkumar
- |
+
+
KCrawley
- |
-
+
@@ -1286,15 +1293,15 @@ Thanks goes to these wonderful people ✨
luke-
- |
+
+
LucidityCrash
- |
-
+
@@ -1329,15 +1336,15 @@ Thanks goes to these wonderful people ✨
michaeljensen
- |
+
+
exhuma
- |
-
+
@@ -1372,15 +1379,15 @@ Thanks goes to these wonderful people ✨
naveensrinivasan
- |
+
+
neuralp
- |
-
+
@@ -1415,15 +1422,15 @@ Thanks goes to these wonderful people ✨
OrvilleQ
- |
+
+
ovidiucp
- |
-
+
@@ -1458,15 +1465,15 @@ Thanks goes to these wonderful people ✨
romansey
- |
+
+
MightySCollins
- |
-
+
@@ -1501,15 +1508,15 @@ Thanks goes to these wonderful people ✨
shyim
- |
+
+
sjmudd
- |
-
+
@@ -1544,15 +1551,15 @@ Thanks goes to these wonderful people ✨
syl20bnr
- |
+
+
sylvaindumont
- |
-
+
@@ -1587,15 +1594,15 @@ Thanks goes to these wonderful people ✨
torus
- |
+
+
VictorKoenders
- |
-
+
@@ -1630,15 +1637,15 @@ Thanks goes to these wonderful people ✨
42wim
- |
+
+
ShiriNmi1520
- |
-
+
@@ -1673,15 +1680,15 @@ Thanks goes to these wonderful people ✨
brainkiller
- |
+
+
cternes
- |
-
+
@@ -1716,15 +1723,15 @@ Thanks goes to these wonderful people ✨
helmutundarnold
- |
+
+
hnws
- |
-
+
@@ -1759,15 +1766,15 @@ Thanks goes to these wonderful people ✨
paralax
- |
+
+
jpduyx
- |
-
+
@@ -1802,15 +1809,15 @@ Thanks goes to these wonderful people ✨
mchamplain
- |
+
+
millerjason
- |
-
+
@@ -1845,15 +1852,15 @@ Thanks goes to these wonderful people ✨
ontheair81
- |
+
+
pravynandas
- |
-
+
@@ -1888,15 +1895,15 @@ Thanks goes to these wonderful people ✨
schnippl0r
- |
+
+
smargold476
- |
-
+
@@ -1931,15 +1938,15 @@ Thanks goes to these wonderful people ✨
vivacarvajalito
- |
+
+
wligtenberg
- |
-
+
From 68a43eb4970f2ab7680ffa470a1d26e37fa375f0 Mon Sep 17 00:00:00 2001
From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Date: Sun, 26 Nov 2023 21:44:47 +0100
Subject: [PATCH 2/5] ci: push `:edge` when `VERSION` is updated (#3662)
Previously, we did not run the workflow on push on `master` when a
release happened because the push on master is guarded by a check on
which files were changed.
With this change, I added `VERSION` to the list of files to consider
when updating `:edge`.
---
.github/workflows/default_on_push.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/default_on_push.yml b/.github/workflows/default_on_push.yml
index a598398920a..209219843df 100644
--- a/.github/workflows/default_on_push.yml
+++ b/.github/workflows/default_on_push.yml
@@ -11,6 +11,7 @@ on:
- .gitmodules
- Dockerfile
- setup.sh
+ - VERSION # also update :edge when a release happens
tags:
- '*.*.*'
From b037288e5ad20b11fab4f375eaf0fe51f2783cd9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 27 Nov 2023 14:22:17 +0100
Subject: [PATCH 3/5] chore(deps): Bump anchore/scan-action from 3.3.6 to 3.3.7
(#3667)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/generic_vulnerability-scan.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/generic_vulnerability-scan.yml b/.github/workflows/generic_vulnerability-scan.yml
index b39cced8616..cad2ac41088 100644
--- a/.github/workflows/generic_vulnerability-scan.yml
+++ b/.github/workflows/generic_vulnerability-scan.yml
@@ -55,7 +55,7 @@ jobs:
provenance: false
- name: 'Run the Anchore Grype scan action'
- uses: anchore/scan-action@v3.3.6
+ uses: anchore/scan-action@v3.3.7
id: scan
with:
image: mailserver-testing:ci
From a11951e39801dac78628a5ad15d2bc15d4f24e7e Mon Sep 17 00:00:00 2001
From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Date: Tue, 28 Nov 2023 10:33:29 +0100
Subject: [PATCH 4/5] hotfix: solve #3665 (#3669)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
---
CHANGELOG.md | 14 +++++++++++++-
docs/content/config/environment.md | 4 ++++
mailserver.env | 2 ++
target/rspamd/local.d/settings.conf | 2 +-
target/scripts/startup/setup.d/security/rspamd.sh | 2 +-
.../parallel/set1/spam_virus/rspamd_full.bats | 2 +-
6 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 71c9de3f44f..a8544b808be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file. The format
> **Note**: Changes and additions listed here are contained in the `:edge` image tag. These changes may not be as stable as released changes.
+## [v13.0.1](https://github.com/docker-mailserver/docker-mailserver/releases/tag/v13.0.1)
+
+This patch release fixes two bugs that Rspamd users encounter on `v13.0.0`. Big thanks to the those that helped to identify these issues!
+
+### Fixed
+
+- **Rspamd:**
+ - The check for correct permission on the private key when signing e-mails with DKIM was flawed. The result was that a false warning was emitted ([#3669](https://github.com/docker-mailserver/docker-mailserver/pull/3669))
+ - When [`RSPAMD_CHECK_AUTHENTICATED=0`][docs::env-rspamd-check-auth], DKIM signing for outbound e-mail was disabled, which is undesirable ([#3669](https://github.com/docker-mailserver/docker-mailserver/pull/3669)). **Make sure to check the documentation of [`RSPAMD_CHECK_AUTHENTICATED`][docs::env-rspamd-check-auth]**!
+
+[docs::env-rspamd-check-auth]: https://docker-mailserver.github.io/docker-mailserver/v13.0/config/environment/#rspamd_check_authenticated
+
## [v13.0.0](https://github.com/docker-mailserver/docker-mailserver/releases/tag/v13.0.0)
### Breaking
@@ -78,7 +90,7 @@ All notable changes to this project will be documented in this file. The format
- `logrotate` setup + Rspamd log path + tests log helper fallback path ([#3576](https://github.com/docker-mailserver/docker-mailserver/pull/3576))
- Setup during container startup is now more resilient ([#3578](https://github.com/docker-mailserver/docker-mailserver/pull/3578))
- Changed DKIM default config location ([#3597](https://github.com/docker-mailserver/docker-mailserver/pull/3597))
- - Removed the symlink for the `override.d/` directory in favor of using `cp`, integrated into the changedetector service, , added a `--force` option for the Rspamd DKIM management, and provided a dedicated helper script for common ENV variables ([#3599](https://github.com/docker-mailserver/docker-mailserver/pull/3599))
+ - Removed the symlink for the `override.d/` directory in favor of using `cp`, integrated into the changedetector service, added a `--force` option for the Rspamd DKIM management, and provided a dedicated helper script for common ENV variables ([#3599](https://github.com/docker-mailserver/docker-mailserver/pull/3599))
- Required permissions are now verified for DKIM private key files ([#3627](https://github.com/docker-mailserver/docker-mailserver/pull/3627))
- **Documentation:**
- Documentation aligned to Compose v2 conventions, `docker-compose` command changed to `docker compose`, `docker-compose.yaml` to `compose.yaml` ([#3295](https://github.com/docker-mailserver/docker-mailserver/pull/3295))
diff --git a/docs/content/config/environment.md b/docs/content/config/environment.md
index 284549f13b7..b8e257cca33 100644
--- a/docs/content/config/environment.md
+++ b/docs/content/config/environment.md
@@ -366,6 +366,10 @@ The purpose of this setting is to opt-out of starting an internal Redis instance
This settings controls whether checks should be performed on emails coming from authenticated users (i.e. most likely outgoing emails). The default value is `0` in order to align better with SpamAssassin. **We recommend** reading through [the Rspamd documentation on scanning outbound emails][rspamd-scanning-outbound] though to decide for yourself whether you need and want this feature.
+!!! note "Not all checks and actions are disabled"
+
+ DKIM signing of e-mails will still happen.
+
- **0** => No checks will be performed for authenticated users
- 1 => All default checks will be performed for authenticated users
diff --git a/mailserver.env b/mailserver.env
index 957a632e128..6878622499a 100644
--- a/mailserver.env
+++ b/mailserver.env
@@ -153,6 +153,8 @@ RSPAMD_LEARN=0
# is `0` in order to align better with SpamAssassin. We recommend reading
# through https://rspamd.com/doc/tutorials/scanning_outbound.html though to
# decide for yourself whether you need and want this feature.
+#
+# Note that DKIM signing of e-mails will still happen.
RSPAMD_CHECK_AUTHENTICATED=0
# Controls whether the Rspamd Greylisting module is enabled.
diff --git a/target/rspamd/local.d/settings.conf b/target/rspamd/local.d/settings.conf
index 4f635e749cd..10c4de88d03 100644
--- a/target/rspamd/local.d/settings.conf
+++ b/target/rspamd/local.d/settings.conf
@@ -6,7 +6,7 @@ authenticated {
priority = high;
authenticated = yes;
apply {
- groups_enabled = [];
+ groups_enabled = [dkim];
}
}
# DMS::SED_TAG::1::END
diff --git a/target/scripts/startup/setup.d/security/rspamd.sh b/target/scripts/startup/setup.d/security/rspamd.sh
index 239397e5925..86786932393 100644
--- a/target/scripts/startup/setup.d/security/rspamd.sh
+++ b/target/scripts/startup/setup.d/security/rspamd.sh
@@ -325,7 +325,7 @@ function __rspamd__check_dkim_permissions() {
__rspamd__log 'trace' "Checking DKIM file '${FILE}'"
# See https://serverfault.com/a/829314 for an explanation on `-exec false {} +`
# We additionally resolve symbolic links to check the permissions of the actual files
- if find "$(realpath -eL "${FILE}")" -user _rspamd -or -group _rspamd -or -perm -o=r -exec false {} +; then
+ if find "$(realpath -eL "${FILE}")" \( -user _rspamd -or -group _rspamd -or -perm -o=r \) -exec false {} +; then
__rspamd__log 'warn' "Rspamd DKIM private key file '${FILE}' does not appear to have correct permissions/ownership for Rspamd to use it"
else
__rspamd__log 'trace' "DKIM file '${FILE}' permissions and ownership appear correct"
diff --git a/test/tests/parallel/set1/spam_virus/rspamd_full.bats b/test/tests/parallel/set1/spam_virus/rspamd_full.bats
index 09d42d46ed1..ba8a23f59c8 100644
--- a/test/tests/parallel/set1/spam_virus/rspamd_full.bats
+++ b/test/tests/parallel/set1/spam_virus/rspamd_full.bats
@@ -307,5 +307,5 @@ function teardown_file() { _default_teardown ; }
_run_in_container grep -E -A 6 'authenticated \{' "${MODULE_FILE}"
assert_success
assert_output --partial 'authenticated = yes;'
- assert_output --partial 'groups_enabled = [];'
+ assert_output --partial 'groups_enabled = [dkim];'
}
From 19e96b5131ba935a0e54e554c3f3a0e6fc66f3b4 Mon Sep 17 00:00:00 2001
From: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Date: Thu, 30 Nov 2023 10:21:26 +1300
Subject: [PATCH 5/5] fix: `update-check.sh` should query GH Releases (#3666)
* 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>
---
.github/workflows/default_on_push.yml | 1 -
.github/workflows/generic_publish.yml | 7 +----
CHANGELOG.md | 2 ++
Dockerfile | 5 ++--
Makefile | 6 +----
.../examples/tutorials/docker-build.md | 27 ++++++++++++-------
target/scripts/build/packages.sh | 6 +++++
target/scripts/start-mailserver.sh | 2 +-
target/scripts/update-check.sh | 7 ++---
9 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/.github/workflows/default_on_push.yml b/.github/workflows/default_on_push.yml
index 209219843df..a598398920a 100644
--- a/.github/workflows/default_on_push.yml
+++ b/.github/workflows/default_on_push.yml
@@ -11,7 +11,6 @@ on:
- .gitmodules
- Dockerfile
- setup.sh
- - VERSION # also update :edge when a release happens
tags:
- '*.*.*'
diff --git a/.github/workflows/generic_publish.yml b/.github/workflows/generic_publish.yml
index 0ed2fd3e3d7..6df534ef94d 100644
--- a/.github/workflows/generic_publish.yml
+++ b/.github/workflows/generic_publish.yml
@@ -66,18 +66,13 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: 'Acquire the image version'
- id: get-version
- shell: bash
- run: echo "version=$(>"${GITHUB_OUTPUT}"
-
- name: 'Build and publish images'
uses: docker/build-push-action@v5.1.0
with:
context: .
build-args: |
+ DMS_RELEASE=${{ github.ref_type == 'tag' && github.ref_name || 'edge' }}
VCS_REVISION=${{ github.sha }}
- VCS_VERSION=${{ steps.get-version.outputs.version }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8544b808be..67aa3ec0eec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@ This patch release fixes two bugs that Rspamd users encounter on `v13.0.0`. Big
### Fixed
+- **Internal:**
+ - The update check service now queries the latest GH release for a version tag instead of a `VERSION` file from the repo.
- **Rspamd:**
- The check for correct permission on the private key when signing e-mails with DKIM was flawed. The result was that a false warning was emitted ([#3669](https://github.com/docker-mailserver/docker-mailserver/pull/3669))
- When [`RSPAMD_CHECK_AUTHENTICATED=0`][docs::env-rspamd-check-auth], DKIM signing for outbound e-mail was disabled, which is undesirable ([#3669](https://github.com/docker-mailserver/docker-mailserver/pull/3669)). **Make sure to check the documentation of [`RSPAMD_CHECK_AUTHENTICATED`][docs::env-rspamd-check-auth]**!
diff --git a/Dockerfile b/Dockerfile
index 5e12689da60..0f19521add4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -295,8 +295,8 @@ COPY target/scripts/startup/setup.d /usr/local/bin/setup.d
#
FROM stage-main AS stage-final
+ARG DMS_RELEASE=edge
ARG VCS_REVISION=unknown
-ARG VCS_VERSION=edge
WORKDIR /
EXPOSE 25 587 143 465 993 110 995 4190
@@ -327,4 +327,5 @@ LABEL org.opencontainers.image.source="https://github.com/docker-mailserver/dock
# ARG invalidates cache when it is used by a layer (implicitly affects RUN)
# Thus to maximize cache, keep these lines last:
LABEL org.opencontainers.image.revision=${VCS_REVISION}
-LABEL org.opencontainers.image.version=${VCS_VERSION}
+LABEL org.opencontainers.image.version=${DMS_RELEASE}
+ENV DMS_RELEASE=${DMS_RELEASE}
diff --git a/Makefile b/Makefile
index 5732cc07ed6..0962c11ae4c 100644
--- a/Makefile
+++ b/Makefile
@@ -18,11 +18,7 @@ BATS_PARALLEL_JOBS ?= 2
all: lint build generate-accounts tests clean
build: ALWAYS_RUN
- @ DOCKER_BUILDKIT=1 docker build \
- --tag $(IMAGE_NAME) \
- --build-arg VCS_VERSION=$(shell git rev-parse --short HEAD) \
- --build-arg VCS_REVISION=$(shell cat VERSION) \
- .
+ @ docker build --tag $(IMAGE_NAME) .
generate-accounts: ALWAYS_RUN
@ cp test/config/templates/postfix-accounts.cf test/config/postfix-accounts.cf
diff --git a/docs/content/examples/tutorials/docker-build.md b/docs/content/examples/tutorials/docker-build.md
index fc6d5c37b23..538da822029 100644
--- a/docs/content/examples/tutorials/docker-build.md
+++ b/docs/content/examples/tutorials/docker-build.md
@@ -10,7 +10,7 @@ You'll need to retrieve the git submodules prior to building your own Docker ima
```sh
git submodule update --init --recursive
-docker build -t .
+docker build --tag .
```
Or, you can clone and retrieve the submodules in one command:
@@ -21,19 +21,26 @@ git clone --recurse-submodules https://github.com/docker-mailserver/docker-mails
### About Docker
-#### Version
+#### Minimum supported version
-We make use of build-features that require a recent version of Docker. Depending on your distribution, please have a look at [the official installation documentation for Docker](https://docs.docker.com/engine/install/) to get the latest version. Otherwise, you may encounter issues, for example with the `--link` flag for a [`#!dockerfile COPY`](https://docs.docker.com/engine/reference/builder/#copy) command.
+We make use of build features that require a recent version of Docker. v23.0 or newer is advised, but earlier releases may work.
-#### Environment
+- To get the latest version for your distribution, please have a look at [the official installation documentation for Docker](https://docs.docker.com/engine/install/).
+- If you are using a version of Docker prior to v23.0, you will need to enable BuildKit via the ENV [`DOCKER_BUILDKIT=1`](https://docs.docker.com/build/buildkit/#getting-started).
-If you are not using `make` to build the image, note that you will need to provide `DOCKER_BUILDKIT=1` to the `docker build` command for the build to succeed.
+#### Build Arguments (Optional)
-#### Build Arguments
+The `Dockerfile` includes several build [`ARG`][docker-docs::builder-arg] instructions that can be configured:
-The `Dockerfile` takes additional, so-called build arguments. These are
+- `DOVECOT_COMMUNITY_REPO`: Install Dovecot from the community repo instead of from Debian (default = 1)
+- `DMS_RELEASE`: The image version (default = edge)
+- `VCS_REVISION`: The git commit hash used for the build (default = unknown)
-1. `VCS_VERSION`: the image version (default = edge)
-2. `VCS_REVISION`: the image revision (default = unknown)
+!!! note
-When using `make` to build the image, these are filled with proper values. You can build the image without supplying these arguments just fine though.
+ - `DMS_RELEASE` (_when not `edge`_) will be used to check for updates from our GH releases page at runtime due to the default feature [`ENABLE_UPDATE_CHECK=1`][docs::env-update-check].
+ - Both `DMS_RELEASE` and `VCS_REVISION` are also used with `opencontainers` metadata [`LABEL`][docker-docs::builder-label] instructions.
+
+[docs::env-update-check]: https://docker-mailserver.github.io/docker-mailserver/latest/config/environment/#enable_update_check
+[docker-docs::builder-arg]: https://docs.docker.com/engine/reference/builder/#using-arg-variables
+[docker-docs::builder-label]: https://docs.docker.com/engine/reference/builder/#label
diff --git a/target/scripts/build/packages.sh b/target/scripts/build/packages.sh
index a025c3b4e08..97ebae04b9c 100644
--- a/target/scripts/build/packages.sh
+++ b/target/scripts/build/packages.sh
@@ -205,6 +205,11 @@ function _install_getmail() {
apt-get "${QUIET}" autoremove
}
+function _install_utils() {
+ _log 'debug' 'Installing utils sourced from Github'
+ curl -sL https://github.com/01mf02/jaq/releases/latest/download/jaq-v1.2.0-x86_64-unknown-linux-musl -o /usr/bin/jaq && chmod +x /usr/bin/jaq
+}
+
function _remove_data_after_package_installations() {
_log 'debug' 'Deleting sensitive files (secrets)'
rm /etc/postsrsd.secret
@@ -228,5 +233,6 @@ _install_dovecot
_install_rspamd
_install_fail2ban
_install_getmail
+_install_utils
_remove_data_after_package_installations
_post_installation_steps
diff --git a/target/scripts/start-mailserver.sh b/target/scripts/start-mailserver.sh
index f0f385f3f6c..cc6c2244e95 100755
--- a/target/scripts/start-mailserver.sh
+++ b/target/scripts/start-mailserver.sh
@@ -120,7 +120,7 @@ function _register_functions() {
[[ ${SMTP_ONLY} -ne 1 ]] && _register_start_daemon '_start_daemon_dovecot'
- [[ ${ENABLE_UPDATE_CHECK} -eq 1 ]] && _register_start_daemon '_start_daemon_update_check'
+ [[ ${ENABLE_UPDATE_CHECK} -eq 1 ]] && [[ ${DMS_RELEASE} != 'edge' ]] && _register_start_daemon '_start_daemon_update_check'
# The order here matters: Since Rspamd is using Redis, Redis should be started before Rspamd.
[[ ${ENABLE_RSPAMD_REDIS} -eq 1 ]] && _register_start_daemon '_start_daemon_rspamd_redis'
diff --git a/target/scripts/update-check.sh b/target/scripts/update-check.sh
index 9010371f241..c30594f4fe1 100755
--- a/target/scripts/update-check.sh
+++ b/target/scripts/update-check.sh
@@ -3,8 +3,8 @@
# shellcheck source=./helpers/log.sh
source /usr/local/bin/helpers/log.sh
-VERSION=$( |