Deleting an active sieve script leaves sieve unfunctional
Dear devs,
I noticed this using Dovecot 2.3.7.2, set up on a newly created Ubuntu 20.04 server.
If I delete a sieve script via KMail's managesieve interface, and the script is active, it leaves sieve unfunctional afterwards.
What's happening is this:
Dovecot creates a USER.sieve script containing all active scripts, e. g.:
require ["include"];
include :personal "some-script";
include :personal "some-other-script";
Now if I delete "some-script", it's actually deleted, but USER.sieve is not updated (and still contains 'include :personal "some-script";').
So next time an email is filtered, this happens:
mail log:
Jul 5 15:20:01 server dovecot: lda(user@domain)<123456>
<xxxxxxxxxxxxxxxxxxxxxx>: sieve: Failed to compile script
`/srv/sieve/user@domain/active-script.sieve' (view user logfile
`/srv/sieve/user@domain/active-script.sieve.log' for more information)
active-script.sieve.log:
sieve: info: started log at Jul 05 14:57:54.
USER: line 12: error: included personal script 'some_script' does not
exist.
USER: error: validation failed.
So, to avoid this, one has to FIRST deactivate the respectice script, so that USER.sieve is updated and THEN delete the script. Or to manually fix USER.sieve on the server, which is surely not what's intended.
So the question is now: Is this a KMail bug, a Doveceot bug, or is the server misconfigured?!
Thanks for all help!
Cheers, Tobias
There's no symlink pointing to that very script. I have virtual users, so I keep the respective sieve scripts in /srv/sieve/user@domain/.
Such a directory looks like that:
active-script.sieve -> USER.sieve
USER.sieve
some-script.sieve
some-other-script.sieve
...
Where USER.sieve is the generated file which includes the activated scripts:
# USER Management Script
#
# This script includes the various active sieve scripts
# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!
#
# For more information, see http://wiki.kolab.org/KEP:14#USER
#
require ["include"];
include :personal "some-script";
include :personal "some-other-script";
Am Montag, 5. Juli 2021, 18:46:30 CEST schrieb dovecot@ptld.com:
There's no symlink pointing to that very script. I have virtual users, so I keep the respective sieve scripts in /srv/sieve/user@domain/.
Such a directory looks like that:
active-script.sieve -> USER.sieve
USER.sieve
some-script.sieve
some-other-script.sieve
...
Where USER.sieve is the generated file which includes the activated scripts:
# USER Management Script
#
# This script includes the various active sieve scripts
# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!
#
# For more information, see http://wiki.kolab.org/KEP:14#USER
#
require ["include"];
include :personal "some-script";
include :personal "some-other-script";
Am Montag, 5. Juli 2021, 18:46:30 CEST schrieb dovecot@ptld.com:
Maybe im misunderstanding what answer you are looking for. Ofcourse sieve wont work without the symlink, that's the point. That is how you disable it. To prevent errors generated by a missing / corrupt script.
Then when you want to use sieve again, create a proper script and enable it, which will autocreate the symlink again.
Okay, I'll try to explain it better ;-)
What I would expect is:
When I delete a sieve script via the managesieve interface of KMail, I would expect that this script is removed from the USER.sieve script so that it's no longer included and not run anymore. Then, it should be deleted.
What happens is:
The script is deleted, but USER.sieve is unchanged and still tries to include it. This leads to a compile error when the next filtering is done.
IMO this simply should not happen: After deleting a script, sieve should simply continue to work -- without the script. But what I actually have to do is that I disable the script, so that USER.sieve doesn't include it anymore and then delete it.
So the question is if KMail should do this automatically (and thus it's a KMail bug) or if Dovecot doesn't act properly (and thus it's a Dovecot bug) -- or if this is a config issue caused by me not being able to setup dovecot properly :-D
I simply think that deleting a sieve script via a managesieve interface should not make the filtering crash and make it necessary to fix this manually ...
Am Montag, 5. Juli 2021, 19:45:37 CEST schrieb dovecot@ptld.com:
As far as sieve is concerned, USER.sieve is the script, still exist and is still active.
Sounds like all you have done is removed a required component of the script being an include file. Sieve doesn't know this, all it knows is USER.sieve is the script, and its active, so it runs it, which fails cause as you know, missing an include file.
The issue is that you have a corrupted sieve script (USER.sieve). I would not consider this a sieve issue. I would consider this a poor design by the makers of whatever control panel you using to update your includes as it should rebuild the script after making such changes. I think your language choice could be confusing, you aren't deleting "a script". You are deleting an include file for "the script" being USER.sieve.
My educated guess is, yes this is a KMail issue.
On 2021-07-05 16:29, Tobias Leupold wrote:
in roundcube one would create another filter-set, with no filter-rules in, then one set the filter-set with no rules in to be default, this will disable sieve, reason is that it must always be atleast one filter-set active, but its not required to have rules in a filter set
hope this works
Well, my workaround for KMail is to simply disable the script to delete before deleting it. This way, it's removed from the auto-generated USER.sieve (where active-script.sieve points to) and it's no problem when the file is actually deleted.
Question is if KMail should do this automatically, or if Dovecot should remove a script to delete from USER.sieve before deleting it. Or if I did something wrong configuring Dovecot ;-)
Am Montag, 5. Juli 2021, 18:58:15 CEST schrieb Benny Pedersen:
On 2021-07-05 10:29 a.m., Tobias Leupold wrote:
IMHO the client (KMail) should take care of it. Perhaps it could also add the "optional" flag in the "include" statement
include :personal :optional "some-script";
participants (6)
-
Benny Pedersen
-
dovecot@ptld.com
-
Oscar del Rio
-
Stephan Bosch
-
Tobias Leupold
-
Tobias Leupold