1
0
mirror of https://github.com/tomav/docker-mailserver.git synced 2024-06-28 04:01:20 +02:00
docker-mailserver/target
Brennan Kinney 5b54d1d32e
refactor: relay.sh (#3845)
* chore: `relay.sh` helper - Reference user config paths via variables

* chore: Better document postfix helper `_vhost_collect_postfix_domains()`

The functionality is effectively the same for the two configs for the most part when it comes to parsing out a domain from the target value.

Virtual aliases is more flexible in value, which may not have a domain-part present (manual user edit).

* chore: `check-for-change.sh` - Support VHOST change visibility

- Moves the "handle changes" logic into it's own scoped function, out of the main change detection loop logic.
- This will be benefit a future commit change that will rely on `VHOST_UPDATED=1`.

* chore: `relay.sh` - Minor revisions to minimize diff noise

- Better phrasing of the current logic comments.
- Regex patterns assigned to variables (easier to grok intention)
- Bulk of the logic for generating `/etc/postfix/relayhost_map` wrapped into a separate function with Postfix config setting handled separately.

* refactor: `relay.sh` opt-out logic

- Split the two distinct features that configure `/etc/postfix/relayhost_map` into separate functions (_`MATCH_VALID` var no longer needed for legacy support_).
- Instead of extracting domains from `postfix-accounts.cf` + `postfix-virtual.cf`, this has already been handled at `/etc/postfix/vhost`, sourcing from there is far less complicated.
- Rename loop var `DOMAIN_PART`to `SENDER_DOMAIN` for better context of what it represents when appended to the config file.
- Revised maintenance notes + guidance towards a future refactor of this relayhost feature support.

* docs: `relay.sh` - Additional comment revisions

* feat: `DEFAULT_RELAY_HOST` can now also use relay credentials ENV

- Remove comment regarding `smtp_sasl_password_maps = static:${RELAY_USER}:${RELAY_PASSWORD}`, it could be used but `main.cf` presently has `644` permissions vs the `sasl_passwd` file permissions of `600`, less secure at preventing leaking of secrets (ignoring the ENV exposure itself).
- Move the `main.cf` settings specific to relayhost credentials support / security into to the relevant function scope instead. This also allows for the configuration to be applied by a change detection event without container restart requirement.
- Outer functions for setup and change detection to call have a clearer config dependency guard, as does the `_legacy_support()`.
- These changes now support `DEFAULT_RELAY_HOST` to leverage the relay credentials ENV as well.
- `DATABASE_RELAYHOSTS` is available in scope to the functions called here that reference it.

* docs: Revised ENV docs on relay host config

Better quality guidance on configuring relay hosts.

* chore: Add entry to `CHANGELOG.md`

* fix: `relay.sh` - `grep` regex compatibility with `+` requires `-E`

* chore: `postfix.sh` - `FIRST_FIELD` => More descriptive field name
2024-01-31 10:24:43 +13:00
..
amavis ci(fix): Normalize for .gitattributes + improve eclint coverage (#3566) 2023-10-04 12:53:32 +02:00
bin general: update base image to Debian 12 ("Bookworm") (#3403) 2024-01-24 17:05:55 +01:00
dovecot fix: Correctly support multiple Dovecot PassDBs (#3812) 2024-01-23 19:11:05 +01:00
fail2ban F2B: update F2B after discussion in #3256 (#3288) 2023-05-01 15:00:35 +02:00
fetchmail Implement fetchmail (#260) (#271) 2016-08-21 22:13:13 +02:00
getmail feature: adding getmail as an alternative to fetchmail (#2803) 2023-05-23 17:25:08 +02:00
logwatch Add logwatch maillog.conf file to support /var/log/mail/ (#2112) 2021-08-11 11:31:00 +02:00
mta-sts-daemon feat: Add MTA-STS support for outbound mail (#3592) 2024-01-13 21:37:20 +13:00
opendkim Fixed KeyTable refile in opendkim.conf https://serverfault.com/a/861701/377751 (#2249) 2021-10-16 19:04:51 +02:00
opendmarc fix: Change the default OpenDMARC policy to reject (#2933) 2022-12-19 08:54:38 +13:00
postfix docs: Add new local dependency (file) for running tests (#3856) 2024-01-30 23:17:58 +13:00
postgrey ci(fix): Normalize for .gitattributes + improve eclint coverage (#3566) 2023-10-04 12:53:32 +02:00
postsrsd config: remove chroot for Dovecot & PostSRSd (#3208) 2023-03-31 12:17:44 +02:00
rspamd spam: use Sieve for rewriting subject with Rspamd & SA/Amavis (#3820) 2024-01-29 13:38:01 +01:00
scripts refactor: relay.sh (#3845) 2024-01-31 10:24:43 +13:00
shared init tests cases ffdhe4096 2020-04-26 22:23:51 +02:00
supervisor general: update base image to Debian 12 ("Bookworm") (#3403) 2024-01-24 17:05:55 +01:00