Bug 328246 - Manage Sieve scripts feature broken
Summary: Manage Sieve scripts feature broken
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: sieve (show other bugs)
Version: 5.2.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 10:54 UTC by Michael Zanetti
Modified: 2017-01-18 21:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Zanetti 2013-11-30 10:54:52 UTC
The "Manage Sieve Scripts" doesn't manage to download any Sieve scripts.

Reproducible: Always

Steps to Reproduce:
1. open Settings -> Manage Sieve Scripts
2. wait for it to load the scripts

Actual Results:  
There is a spinner showing up on all mail accounts, indicating that it actually does something, but the result is empty.

Expected Results:  
My Sieve scripts (which I have edited before with KMail2) should appear in the list so they can be edited.

Haven't used this feature in quite a while so I don't know when it broke. It was definitely working a year ago or so. Now, trying with 4.12 beta it's not working any more.
Comment 1 Laurent Montel 2013-11-30 12:47:59 UTC
Do you have debug version ? (you have a menu entry to debug sieve in tools menu in kmail

Or do you test your server on thunderbird for example ?
Comment 2 Michael Zanetti 2013-11-30 18:21:30 UTC
(In reply to comment #1)
> Do you have debug version ? (you have a menu entry to debug sieve in tools
> menu in kmail

No, I don't have that.

> 
> Or do you test your server on thunderbird for example ?

I have tested the server with roundcube. I can sucessfully edit the sieve filter there.
Comment 3 Laurent Montel 2013-12-01 07:03:43 UTC
rouncube is a test valid.
I need to know if you can edit it in a application.
Use same settings etc.
Look at your port etc.
Perhaps that your port is not ok
Comment 4 Laurent Montel 2013-12-04 08:44:14 UTC
So ?
Comment 5 Laurent Montel 2013-12-10 07:54:00 UTC
w
Comment 6 Laurent Montel 2013-12-10 07:54:12 UTC
wait for info
Comment 7 Michael Zanetti 2013-12-10 10:17:13 UTC
Yes, I've installed thunderbird and the Sieve plugin and that worked fine too.

However, in the meantime I've upgraded my KDE installation (Kontact Version 4.12 rc1) and turns out it works again. No idea what it didn't connect with the betas.
Comment 8 Laurent Montel 2013-12-11 08:59:28 UTC
Ok so bug is fixed.
It's good to close bug too when user can't reproduce it.

Regards.
Comment 9 Tom Mittelstädt 2016-05-01 15:49:36 UTC
Still present in kmail2 5.1.3

sieve scripts are only discovered if kmail is freshly startet exactly one time. If I access the dialog a second time kmail tries forever to get the script list.
it works again after a kmail-restart

Same if the syntax check detects an error. the whole sieve management part becomes unresponsive and does simply nothing until kmail is restarted
Comment 10 Laurent Montel 2016-05-02 06:03:55 UTC
Ok I see the bug.
I investigate it
Comment 11 Laurent Montel 2016-05-02 07:14:09 UTC
Git commit aa295b6cf15ee67a980b2858ccad6e6e8e769585 by Montel Laurent.
Committed on 02/05/2016 at 07:13.
Pushed by mlaurent into branch 'Applications/16.04'.

Fix Bug 328246 - Manage Sieve scripts feature broken

FIXED-IN: 5.2.1

M  +1    -0    src/kmanagesieve/sessionthread.cpp

http://commits.kde.org/libksieve/aa295b6cf15ee67a980b2858ccad6e6e8e769585
Comment 12 David Faure 2016-07-14 11:00:09 UTC
This patch was reverted, it broke other servers, reopening.

Looking at this code, I found another issue though, maybe it fixes this?
https://phabricator.kde.org/D2163
Comment 13 David Faure 2016-07-14 11:32:33 UTC
OK the actual issue is elsewhere. Things are happening out of order, sometimes (race condition).

KManageSieve::SessionThread::doStartSsl: 0x3aa7f00 SessionThread::doStartSsl()
KManageSieve::SessionThread::doSendData: 0x3aa7f00 C:  "LISTSCRIPTS"
[....]
KManageSieve::SessionThread::doSendData: 0x3aa7f00 C:  "AUTHENTICATE \"PLAIN\" [...]\""
KManageSieve::SessionThread::slotDataReceived: 0x3aa7f00 S:  "NO \"Authenticate first\""

This LISTSCRIPTS should only happen after authenticate, not before.
I sometimes see a race condition the other way around, m_state in Session is not yet PostTls so all responses are unhandled, and only then sslDone() is called.
Comment 14 David Faure 2016-07-14 12:18:27 UTC
Fix available at https://phabricator.kde.org/D2167
Comment 15 Tom Mittelstädt 2016-07-14 13:25:41 UTC
Does this also fixes the issues with dovecot (2.2.10)?
at the moment (kmail2 5.1.3) I have the sames issues as in #1. A workaround is to restart kmail completely and right afterwards the manage sieve functionality works once.
Comment 16 David Faure 2016-07-14 13:34:20 UTC
I can't possibly know that :)

If you see "KTcpSocket::showSslErrors" in the *kmail* debug output, then it's likely that this patch fixes it.
Comment 17 Denis Kurz 2017-01-18 19:05:09 UTC
(In reply to David Faure from comment #14)
> Fix available at https://phabricator.kde.org/D2167

I'm not quite sure, but this patch seems to have landed some time ago. Can this bug be closed FIXED?
Comment 18 Tom Mittelstädt 2017-01-18 20:54:15 UTC
it is still broken in 5.2.3
Comment 19 Denis Kurz 2017-01-18 21:12:28 UTC
In the meantime, I managed to extract the information from phabricator*: The earliest stable version the above patch was 16.08.0 (5.3.0), so it's no surprise that it isn't fixed in 5.2.3. So there's a good chance that the bug was actually fixed. I adjusted the version-fixed-in and latest-commit info. Also, thank you for reporting back, and so fast.

If it's still broken in post-5.3.0 versions, please tell me so and I'll reopen.

* fyi: the phabricator page lists all tags that include the patch, and 16.08.0 is listed there, among others