fix: Ensure .svbin
files are newer than .sieve
source files
#3779
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
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.
Fixes: #3558 (comment)
Context
This fix prevents the two error log lines below that are preceding the log where the sieve script is run successfully regardless:
I've only witnessed this personally on my current system (AMD 7940HS with Windows 11 + WSL2), it's possibly related to the filesystem layer and changes happening within a certain window to be coalesced into the same timestamp as an optimization? 🤷♂️
If the
.sieve
file is newer (or the same timestamp in this case), Dovecot will try compile a new.svbin
(and presumably fallback to the existing one when that fails).We can see that the failure is due to the VMail user
docker:docker
/5000:5000
lacking permissions to write.svbin
as the directory ownership isdovecot:root
/110:0
with755
permissions.misc.sh
,dovecot.sh
,rspamd.sh
all runsievec
for.sieve
files in either/usr/lib/dovecot/sieve-pipe
or/usr/lib/dovecot/sieve-global
. As such, while we could adjust the permission for the VMail static user, it won't support deployments with accounts that have their own unique UID (some LDAP users are known to have this setup).mtime
is adjusted as this PR does, as we are intentionally compiling these during startup scripts and there should be no need to compile again afterwards when mail is received and processed by these scripts.Type of change
Checklist:
CHANGELOG.md