docker-mailserver/test
Brennan Kinney 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
..
bats@e8c840b58f update BATS & helper + minor updates to BATS variables (#2988) 2023-01-09 08:54:04 +01:00
config fix: Avoid alias being used as regex during dovecot dummy account userdb detection (#4222) 2024-10-12 11:34:20 +13:00
files fix: Correctly support multiple Dovecot PassDBs (#3812) 2024-01-23 19:11:05 +01:00
helper refactor: setup CLI `open-dkim` (#4375) 2025-03-31 11:27:28 +02:00
linting Update `.ecrc.json` to exclude `CONTRIBUTORS.md` (#4020) 2024-05-17 09:57:07 +02:00
test_helper Change 'until' style (#3366) 2023-05-26 07:42:03 +02:00
tests refactor: setup CLI `open-dkim` (#4375) 2025-03-31 11:27:28 +02:00