Bug 439518 - Deleting an active sieve script leaves sieve unfunctional (using Dovecot)
Summary: Deleting an active sieve script leaves sieve unfunctional (using Dovecot)
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: sieve (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-05 14:20 UTC by Tobias Leupold
Modified: 2021-07-15 11:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Leupold 2021-07-05 14:20:34 UTC
Dear devs,

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?!
Comment 1 Laurent Montel 2021-07-15 11:10:42 UTC
I need to make a big change in libksieve for doing it.
It's on my todo list 21.12
Comment 2 Tobias Leupold 2021-07-15 11:14:56 UTC
Nice if this is on the to do list :-)

I also asked the Dovecot mailing list about this problem. The final statement was that handling this correctly is up to the managesieve client.

Thanks in advance for addressing this!