docker-mailserver/test
Brennan Kinney 5254f7c658
fix: check-for-changes.sh should not fall out of sync with shared logic (#2260)
Removes duplicate logic from `check-for-changes.sh` that is used/maintained elsewhere to avoid risk of problems, as this code is already starting to diverge / rot.

---

Previously the change detection support has had code added for rebuilding config upon change detection which is the same as code run during startup scripts. Unfortunately over time this has fallen out of sync. Mostly the startup scripts would get maintenance and the contributor and reviewers may not have been aware of the duplicate code handled by `check-for-changes.sh`.

That code was starting to diverge in addition to some changes in structure (_eg: relay host logic seems interleaved here vs separated out in startup scripts_). I wanted to address this before it risks becoming a much bigger headache.

Rather than bloat `helper-functions.sh` further, I've added a `helpers/` folder extracting relevant common logic between startup scripts and `changedetector`. If you want to follow that process I've kept scoped commits to make those diffs easier. Some minor changes/improvements were added but nothing significant.

---

- chore: Extract relay host logic to new `relay.sh` helper
- chore: Extract `/etc/postfix/sasl_passwd` logic to new `sasl.sh` helper
- chore: Extract `postfix-accounts.cf` logic to new `accounts.sh` helper
- chore: Extract `/etc/aliases` logic to new `aliases.sh` helper
- chore: Extract `/etc/postfix/vhost` logic to new `postfix.sh` helper

- chore: Add inline docs for Postfix configs
> These are possibly more verbose than needed and can be reduced at a later stage.
> They are helpful during this refactor process while investigating that everything is handled correctly.

`accounts.sh`: 
- Add note regarding potential bug for bare domain setups with `/etc/postfix/vhost` and `mydestination` sharing same domain value.

`relay.sh`: 
- Remove the tabs for a single space delimiter, revised associated comment.
- Add PR reference for original `_populate_relayhost_map` implementation which has some useful details.


Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2021-11-21 09:33:49 +13:00
..
bats@54e965fa9d Revert "check-for-changes: performance improvements + wait for settle (#2104)" 2021-08-28 19:16:34 -04:00
config tests(feat): Complete rewrite of letsencrypt tests (#2286) 2021-11-16 16:00:16 +01:00
docker-openldap formatting files according to standard (#1619) 2020-09-24 14:54:21 +02:00
linting fix: check-for-changes.sh should not fall out of sync with shared logic (#2260) 2021-11-21 09:33:49 +13:00
test-files tests(chore): Adjust supported FQDNs in test certs + add wildcard and acme.json configs (#2284) 2021-11-03 20:25:25 +00:00
test_helper tests(feat): Complete rewrite of letsencrypt tests (#2286) 2021-11-16 16:00:16 +01:00
default_relay_host.bats Provide complete refactoring of openDKIM script (#1812) 2021-02-18 10:29:34 +01:00
helper-functions.bats Lock file create and remove improvements (#2183) 2021-09-13 20:09:01 +12:00
mail_changedetector.bats fix: check-for-changes.sh should not fall out of sync with shared logic (#2260) 2021-11-21 09:33:49 +13:00
mail_disabled_clamav_spamassassin.bats introduce variable to control Amavis' loglevel (#1947) 2021-05-06 23:51:45 +02:00
mail_fail2ban.bats introduce F2B v0.11 (#1965) 2021-05-15 11:11:10 +02:00
mail_fetchmail.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_fetchmail_parallel.bats Solve Fetchmail imap idle issue (#10) 2021-01-17 10:39:09 +01:00
mail_hostname.bats refactor: Internal HOSTNAME and DOMAINNAME configuration (#2280) 2021-11-16 10:50:45 +13:00
mail_lmtp_ip.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_pop3.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_postfix_inet.bats Catch errors on config duplication command 2020-10-20 09:33:47 +02:00
mail_postscreen.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_privacy.bats fix: Remove mkcert.sh usage + _setup_ssl refactor. (#2196) 2021-09-20 00:31:11 +12:00
mail_quotas_disabled.bats Catch errors on config duplication command 2020-10-20 09:33:47 +02:00
mail_smtponly.bats use wait_for_smtp function instead of sleep 2020-11-06 14:11:42 +01:00
mail_spam_bounced.bats tests(feat): Refactor test_helper/common.bash common_container methods (#2275) 2021-11-05 09:35:01 +13:00
mail_spam_junk_folder.bats Fix timing dependent failures 2020-10-20 14:14:04 +02:00
mail_special_use_folders.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_ssl_letsencrypt.bats tests(feat): Complete rewrite of letsencrypt tests (#2286) 2021-11-16 16:00:16 +01:00
mail_ssl_manual.bats fix: Remove mkcert.sh usage + _setup_ssl refactor. (#2196) 2021-09-20 00:31:11 +12:00
mail_tls_dhparams.bats fix: Enable DH parameters (ffdhe4096) by default (#2192) 2021-09-15 20:28:04 +12:00
mail_undef_spam_subject.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_with_imap.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_with_ldap.bats fix: Remove mkcert.sh usage + _setup_ssl refactor. (#2196) 2021-09-20 00:31:11 +12:00
mail_with_mdbox.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_with_postgrey.bats removing bl.spamcop.net for 8.0.1 2021-01-31 16:05:05 +01:00
mail_with_postgrey_disabled_by_default.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
mail_with_relays.bats Revert "check-for-changes: performance improvements + wait for settle (#2104)" 2021-08-28 19:16:34 -04:00
mail_with_sdbox.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
no_container.bats setup.sh: docker_container first, then fall back to docker_image (#2134) 2021-09-06 10:13:12 +00:00
open_dkim.bats chore: Housekeeping on the 'open-dkim' script (#2267) 2021-10-30 10:10:32 +00:00
permit_docker.bats first refactoring fr *.bats according to shellcheck 2020-11-05 19:15:28 +01:00
security_tls_cipherlists.bats Dual certificate support (eg ECDSA with RSA fallback) (#1801) 2021-02-21 23:43:41 +01:00
test_helper.bats follow up on #2177 with @polarathene's suggestions (#2180) 2021-09-12 00:43:42 +12:00
tests.bats fix(listmailuser): Don't query quota, if ENABLE_QUOTAS is not 1 2021-11-01 12:09:47 +01:00