📝 Preliminary Checks
👀 What Happened?
- Dovecot attempts to use the
.svbin that was compiled during startup, but notices it is "outdated" since it has the same timestamp as the .sieve file.
- Dovecot then compiles it again, and attempts to write the new compiled binary to the global dir but fails due to lack of permissions (this is expected, the vmail user should not have write access to this location).
- Errors are logged and it continues to run the compiled binary successfully.
👟 Reproduction Steps
Failure seems to occur during this part of startup when the files share the same timestamp between .sieve and .svbin extensions:
|
chown dovecot:root -R /usr/lib/dovecot/sieve-* |
|
find /usr/lib/dovecot/sieve-* -type d -exec chmod 755 {} + |
|
find /usr/lib/dovecot/sieve-{filter,pipe} -type f -exec chmod +x {} + |
In the dovecot_sieve.bats test, these two emails trigger a before + after global sieve scripts:
|
# Single mail sent from '[email protected]' that is handled by User (relocate) and Global (copy) sieves for user1: |
|
_send_email 'email-templates/sieve-spam-folder' |
|
# Mail for user2 triggers the sieve-pipe: |
|
_send_email 'email-templates/sieve-pipe' |
# Failure due to identical timestamps between `.sieve` + `.svbin`:
$ ls -l --time-style full-iso /usr/lib/dovecot/sieve-global/before/
-rw-r--r-- 1 dovecot root 107 2023-09-30 03:40:18.188085494 +0000 50-before.dovecot.sieve
-rw-r--r-- 1 dovecot root 309 2023-09-30 03:40:18.188085494 +0000 50-before.dovecot.svbin
$ ls -l --time-style full-iso /usr/lib/dovecot/sieve-global/after
-rw-r--r-- 1 dovecot root 149 2023-09-30 03:40:18.208085480 +0000 spam_to_junk.sieve
-rw-r--r-- 1 dovecot root 329 2023-09-30 03:40:18.208085480 +0000 spam_to_junk.svbin
# No failure (`.svbin` is newer):
$ ls -l --time-style full-iso /usr/lib/dovecot/sieve-global/before/
-rw-r--r-- 1 dovecot root 107 2023-09-30 03:39:05.725548197 +0000 50-before.dovecot.sieve
-rw-r--r-- 1 dovecot root 309 2023-09-30 03:39:05.735548158 +0000 50-before.dovecot.svbin
$ ls -l --time-style full-iso /usr/lib/dovecot/sieve-global/after
-rw-r--r-- 1 dovecot root 149 2023-09-30 03:39:05.745548110 +0000 spam_to_junk.sieve
-rw-r--r-- 1 dovecot root 329 2023-09-30 03:39:05.755548059 +0000 spam_to_junk.svbin
Multiple runs of a test like vmail-id.bats could be run before it was caught on my system. Other times it would occur frequently. Perhaps the system is a bit too fast (Ryzen 7940HS + NVMe disk), or WSL2 influenced the files being updated with the same timestamp 🤷♂️
I also observed a related failure with this part of the rspamd_full.bats:
|
for LINE in "${LEARN_SPAM_LINES[@]}"; do |
|
assert_output --partial "${LINE}" |
|
done |
Logs are shared below where the above snippet of the test is checking the logs for these:
|
local LEARN_HAM_LINES=( |
|
"sieve: file storage: script: Opened script \`learn-ham'" |
|
'sieve: file storage: Using Sieve script path: /usr/lib/dovecot/sieve-pipe/learn-ham.sieve' |
|
"sieve: Executing script from \`/usr/lib/dovecot/sieve-pipe/learn-ham.svbin'" |
|
"Finished running script \`/usr/lib/dovecot/sieve-pipe/learn-ham.svbin'" |
|
"left message in mailbox 'INBOX'" |
|
) |
I'm not sure why the rspamd_full.bats tests mail.log file had Debug: log entries. I wasn't able to reproduce those with the dovecot_sieve.bats test when inspecting mail.log, only the Error: log lines would show.
🐋 DMS Version
edge (will become v13)
💻 Operating System and Architecture
Linux Kernel 5.15.123 - WSL2 x86_64 (Windows with Ubuntu 22.04)
⚙️ Container configuration files
I only used the existing test suite. Logs provide the command used to run them
📜 Relevant log output
$ NAME=mailserver-testing:ci make test/dovecot_sieve
# dovecot_sieve.bats failure (with added test-case to grep for error from `vmail-id.bats`), logs:
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><ZhTCH8OSF2XuAgAAUi6ngw>: Error: sieve: binary /usr/lib/dovecot/sieve-global/before/50-before.dovecot.svbin: save: failed to create temporary file: open(/usr/lib/dovecot/sieve-global/before/50-before.dovecot.svbin.) failed: Permission denied (euid=9042(docker) egid=9042(docker) missing +w perm: /usr/lib/dovecot/sieve-global/before, dir owned by 110:0 mode=0755)
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><ZhTCH8OSF2XuAgAAUi6ngw>: Error: sieve: The LDA Sieve plugin does not have permission to save global Sieve script binaries; global Sieve scripts like `/usr/lib/dovecot/sieve-global/before/50-before.dovecot.sieve' need to be pre-compiled using the sievec tool
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><kFy1K8OSF2XuAgAAUi6ngw>: Error: sieve: binary /usr/lib/dovecot/sieve-global/before/50-before.dovecot.svbin: save: failed to create temporary file: open(/usr/lib/dovecot/sieve-global/before/50-before.dovecot.svbin.) failed: Permission denied (euid=9042(docker) egid=9042(docker) missing +w perm: /usr/lib/dovecot/sieve-global/before, dir owned by 110:0 mode=0755)
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><kFy1K8OSF2XuAgAAUi6ngw>: Error: sieve: The LDA Sieve plugin does not have permission to save global Sieve script binaries; global Sieve scripts like `/usr/lib/dovecot/sieve-global/before/50-before.dovecot.sieve' need to be pre-compiled using the sievec tool
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><kFy1K8OSF2XuAgAAUi6ngw>: Error: sieve: binary /usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin: save: failed to create temporary file: open(/usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin.) failed: Permission denied (euid=9042(docker) egid=9042(docker) missing +w perm: /usr/lib/dovecot/sieve-global/after, dir owned by 110:0 mode=0755)
Sep 30 03:15:15 mail dovecot: lmtp([email protected])<750><kFy1K8OSF2XuAgAAUi6ngw>: Error: sieve: The LDA Sieve plugin does not have permission to save global Sieve script binaries; global Sieve scripts like `/usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve' need to be pre-compiled using the sievec tool
$ make test/rspamd_full
# Failure logs output from the `RSPAMD_LEARN works` test-case:
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: Loading script /usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: file storage: script: Sieve binary `/usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin' is not newer than the Sieve script `/usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve' (2023-09-30 02:39:26.331550613 <= 2023-09-30 02:39:26.331550613)
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: binary /usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin: up-to-date: script metadata indicates that binary is not up-to-date
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: Script binary /usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin is not up-to-date
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: file storage: script: Opened script for reading
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Debug: sieve: Script `spam_to_junk' from /usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve successfully compiled
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Error: sieve: binary /usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin: save: failed to create temporary file: open(/usr/lib/dovecot/sieve-global/after/spam_to_junk.svbin.) failed: Permission denied (euid=9042(docker) egid=9042(docker) missing +w perm: /usr/lib/dovecot/sieve-global/after, dir owned by 110:0 mode=0755)
Sep 30 02:39:42 mail dovecot: lmtp([email protected])<1032><iLMABm6KF2UIBAAAUi6ngw>: Error: sieve: The LDA Sieve plugin does not have permission to save global Sieve script binaries; global Sieve scripts like `/usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve' need to be pre-compiled using the sievec tool
Improvements to this form?
No response
📝 Preliminary Checks
👀 What Happened?
.svbinthat was compiled during startup, but notices it is "outdated" since it has the same timestamp as the.sievefile.👟 Reproduction Steps
Failure seems to occur during this part of startup when the files share the same timestamp between
.sieveand.svbinextensions:docker-mailserver/target/scripts/startup/setup.d/dovecot.sh
Lines 79 to 81 in bd96c11
In the
dovecot_sieve.batstest, these two emails trigger abefore+afterglobal sieve scripts:docker-mailserver/test/tests/parallel/set1/dovecot/dovecot_sieve.bats
Lines 28 to 31 in 89cb6d8
Multiple runs of a test like
vmail-id.batscould be run before it was caught on my system. Other times it would occur frequently. Perhaps the system is a bit too fast (Ryzen 7940HS + NVMe disk), or WSL2 influenced the files being updated with the same timestamp 🤷♂️I also observed a related failure with this part of the
rspamd_full.bats:docker-mailserver/test/tests/parallel/set1/spam_virus/rspamd_full.bats
Lines 269 to 271 in bd96c11
Logs are shared below where the above snippet of the test is checking the logs for these:
docker-mailserver/test/tests/parallel/set1/spam_virus/rspamd_full.bats
Lines 252 to 258 in bd96c11
I'm not sure why the
rspamd_full.batstestsmail.logfile hadDebug:log entries. I wasn't able to reproduce those with thedovecot_sieve.batstest when inspectingmail.log, only theError:log lines would show.🐋 DMS Version
edge (will become v13)
💻 Operating System and Architecture
Linux Kernel 5.15.123 - WSL2 x86_64 (Windows with Ubuntu 22.04)
⚙️ Container configuration files
I only used the existing test suite. Logs provide the command used to run them📜 Relevant log output
Improvements to this form?
No response