From 4ae9a5b621dcd53343ce70a4d16970efd8f0e126 Mon Sep 17 00:00:00 2001 From: polarathene <5098581+polarathene@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:25:41 +1300 Subject: [PATCH] fix: Ensure `.svbin` files are newer than `.sieve` source files This change prevents operations applied to both files that adjusts their `mtime` attribute which sometimes results in the same timestamp which causes Dovecot to log errors. Functionally there doesn't appear to be any issue. After logging the error, the existing svbin is used and works correctly. This does help avoid false-positives in the test-suite that are asserting for errors in a log. --- target/scripts/startup/setup-stack.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/scripts/startup/setup-stack.sh b/target/scripts/startup/setup-stack.sh index 060dadb2..8505bd93 100644 --- a/target/scripts/startup/setup-stack.sh +++ b/target/scripts/startup/setup-stack.sh @@ -20,6 +20,16 @@ function _setup() { ${FUNC} done + _setup_post +} + +function _setup_post() { + # Dovecot `.svbin` files must have a newer mtime than their `.sieve` source files, + # Modifications during setup to these files sometimes results in a common mtime value. + # Handled during post-setup as setup of Dovecot Sieve scripts is not centralized. + find /usr/lib/dovecot/ -iname *.sieve -exec touch -d '2 seconds ago' {} + + find /usr/lib/dovecot/ -iname *.svbin -exec touch -d '1 seconds ago' {} + + # All startup modifications to configs should have taken place before calling this: _prepare_for_change_detection }