docker-mailserver/target/scripts/helpers
Brennan Kinney a7e6439a39
fix: Workaround postconf write settling logic (#2998)
* fix: Workaround `postconf` write settle logic

After updating `main.cf`, to avoid an enforced delay from reading the config by postfix tools, we can ensure the modified time is at least 2 seconds in the past as a workaround. This should be ok with our usage AFAIK.

Shaves off 2+ seconds roughly off each container startup, reduces roughly 2+ minutes off tests.

* chore: Only modify `mtime` if less than 2 seconds ago

- Slight improvement by avoiding unnecessary writes with a conditional check on the util method.
- Can more comfortably call this during `postfix reload` in the change detection cycle now.
- Identified other tests that'd benefit from this, created a helper method to call instead of copy/paste.
- The `setup email restrict` command also did a modification and reload. Added util method here too.

* tests(fix): `mail_smtponly.bats` should wait for Postfix

- `postfix reload` fails if the service is not ready yet.
- `service postfix reload` and `/etc/init.d/postfix reload` presumably wait until it is ready? (as these work regardless)

* chore: Review feedback - Move reload method into utilities
2023-01-13 10:10:58 +13:00
..
database Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
accounts.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
aliases.sh fix: Workaround postconf write settling logic (#2998) 2023-01-13 10:10:58 +13:00
change-detection.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
dns.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
error.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
index.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
lock.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
log.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
network.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
postfix.sh Remove unusual space from shebang line (#2834) 2022-10-17 10:40:09 +02:00
relay.sh Fix several typos (#2990) 2023-01-10 14:13:50 +01:00
ssl.sh chore: Drop support for deprecated TLS versions (#2945) 2022-12-24 02:30:43 +13:00
utils.sh fix: Workaround postconf write settling logic (#2998) 2023-01-13 10:10:58 +13:00
variables.sh feature: provide initial Rspamd support (#2902) 2023-01-05 08:39:00 +01:00