Bug 243832

Summary: sieve can't login because of enum mistmatch between kmail and imap_resource
Product: [Frameworks and Libraries] Akonadi Reporter: David Faure <faure>
Component: IMAP resourceAssignee: Casey Link <unnamedrambler>
Status: RESOLVED FIXED    
Severity: normal CC: ervin, kdepim-bugs, matija, vkrause
Priority: NOR    
Version: 4.5   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description David Faure 2010-07-07 10:31:01 UTC
Version:           4.5 (using Devel) 
OS:                Linux

KMail::Util::findSieveUrlForAccount calls authentication() on the imapsettings dbus interface, and treats it as a KIMAP::LoginJob enum.

But the imap resource implements authentication() as a MailTransport::Transport::EnumAuthenticationType::type.

So my imap (on mail.kdab.com) auth type of "Plain" gets wrongly converted to "ANONYMOUS", and the sieve kioslave doesn't manage to log in.

Reproducible: Always

Steps to Reproduce:
1) Configure an IMAP account (e.g. on mail.kdab.com)
2) Settings / Manage sieve scripts.

Actual Results:  
Authorization failed, Authentication failed.
Most likely the password is wrong.
The server responded:
NO "Authentication Error" authentication not supported


I asked Kevin and he told me that the code was using the KIMAP::LoginJob enum initially and has been changed to use the MailTransport enum later on.
I indeed remember the migration issue caused by that.

Isn't the right fix, to avoid forcing our users through that migration problem, to go back to the KIMAP::LoginJob enum?
This would fix the migration issue -and- fix the bad enum conversion that makes it impossible to edit sieve scripts currently.
Comment 1 Casey Link 2010-07-11 05:13:54 UTC
Thanks for the report David. 


The "migration issue" you're referring to isn't an actual issue any longer. The migrator correctly converts old configs to the currently used MailTransport enum.

The issues you (and others) ran into awhile back was when I made those enum changes initially, so only those who were running trunk at that time were affected. Considering the lack of reports regarding this issue from trunk issues, it is not a real problem.

More details: When I pushed the enum changes, I updated the migrator so everyone who migrates will not be affected, however I did not upgrade _existing_ kmail2 configs. 

Regarding the actual bug report: the fix is to make KMail::Util::findSieveUrlForAccount  use the MailTransport enum.
Comment 2 Casey Link 2010-07-11 06:10:35 UTC
SVN commit 1148564 by link:

Update the sieve script util function to use the MailTransport enum.

Did not test, as I have no sieve scripts. David, please verify.
CCBUG: 243832

 M  +8 -9      util.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1148564
Comment 3 Kevin Ottens 2010-07-12 08:24:34 UTC
Well, I think David's point was about migration for existing deployment of the IMAP resource from KDEPIM 4.4 (first release was in there). So effectively those one will break with a 4.5 upgrade.
Comment 4 Thomas McGuire 2010-07-13 22:02:32 UTC
SVN commit 1149610 by tmcguire:

Backport r1148564: Update the sieve script util function to use the MailTransport enum.

CCBUG: 243832

 M  +8 -9      util.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1149610