Bug 311456

Summary: imap idle is not working with GSSAPI
Product: [Frameworks and Libraries] Akonadi Reporter: markus hetzenecker <markus.hetzenecker>
Component: IMAP resourceAssignee: Christian Mollekopf <chrigi_1>
Status: RESOLVED FIXED    
Severity: normal CC: dennis.schridde, kdenis, kdepim-bugs, mollekopf, montel, vkrause
Priority: NOR    
Version: 5.3.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 5.5.1

Description markus hetzenecker 2012-12-10 09:55:56 UTC
send an email and see if kmail shows "new mail"
This is working with other imap accounts, but using plain authentication.
it is also working with the imap account in question with plain authentication, but not with GSSAPI authentication.

Reproducible: Always

Steps to Reproduce:
1. create imap access, configure plain authentication.
2. send an email to this account and kmail should show "new mail".
3. switch to GSSAPI authenitcation and restart akonadi/kmail.
4. send email to this account, but kmail keeps quiet.
Actual Results:  
kmail doesn`t show "new mail"

Expected Results:  
kmail shows "new mail"

debug with export KIMAP_LOGFILE=/tmp/imaplog

working connection has one file per imap access
not working (with GSSAPI auth) has 2 files:

imaplog.7111.1 :
C: A000003 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED COMPRESS=DEFLATE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE SCAN IDLE LISTEXT LIST-SUBSCRIBED X-NETSCAPE URLAUTH
S: A000003 OK Completed
C: A000004 NAMESPACE
S: * NAMESPACE ( ("" ".") ) ( ("Other Users." ".") ) ( ("Shared Folders." ".") )
S: A000004 OK Completed
C: A000005 LIST "" *
S: * LIST ( \Noinferiors ) . INBOX
--- some lines not included ---
S: A000005 OK Completed ( 0.000 secs 17 calls )
C: A000006 LOGOUT
S: * BYE LOGOUT received
S: A000006 OK Completed

imaplog.7111.2 :
C: A000003 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED COMPRESS=DEFLATE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE SCAN IDLE LISTEXT LIST-SUBSCRIBED X-NETSCAPE URLAUTH
S: A000003 OK Completed
C: A000004 NAMESPACE
S: * NAMESPACE ( ("" ".") ) ( ("Other Users." ".") ) ( ("Shared Folders." ".") )
S: A000004 OK Completed
C: A000005 LIST "" *
S: * LIST ( \Noinferiors ) . INBOX
S: A000005 OK Completed ( 0.000 secs 17 calls )
C: A000006 SELECT "INBOX"
S: * FLAGS ( \Answered \Flagged \Draft \Deleted \Seen $ENCRYPTED $SENT $ATTACHMENT )
S: * OK [ PERMANENTFLAGS ( \Answered \Flagged \Draft \Deleted \Seen $ENCRYPTED $SENT $ATTACHMENT \* )  ]
S: * 7 EXISTS
--- next lines not included ---
--- no idle command


a working log file shows at the end:
C: A000007 IDLE
S: + idling
S: * OK Still here
Comment 1 Laurent Montel 2012-12-10 10:11:57 UTC

*** This bug has been marked as a duplicate of bug 267884 ***
Comment 2 markus hetzenecker 2012-12-12 12:21:11 UTC
its not a duplicate of Bug 267884.
i can authenticate, read and write my email with GSSAPI.
the second file is bc of sieve (i think)

more info:
imap server is centos 6, cyrus-imapd-2.3.16-6.el6_2.5.x86_64

/tmp/imaplog.3517.1 :
C: A000003 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED COMPRESS=DEFLATE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHIL
DREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE SCAN IDLE LISTEXT LIST-SUBSCRIBED X-NETSCAPE URLAU
TH
S: A000003 OK Completed
C: A000004 NAMESPACE
S: * NAMESPACE ( ("" ".") ) ( ("Other Users." ".") ) ( ("Shared Folders." ".") )
S: A000004 OK Completed
C: A000005 LIST "" *
S: * LIST ( \Noinferiors ) . INBOX
S: A000005 OK Completed ( 0.000 secs 17 calls )


missing at the end
C: A000007 IDLE
S: + IDLE accepted, awaiting DONE command.

akonadiconsole shows:
Status: online, idle
Comment 3 markus hetzenecker 2013-03-25 07:21:10 UTC
verified again with fedora 17.
as before: i can authenticate, to read and write my email with GSSAPI.
but after sending a mail, it does not show immediatly the new mail arrived arrived, only after the "check for new mail".
workaround: check every 15 minutes for new mail, which is not nice for a large userbase.

client (fedora17, all updates):
kdepim-4.10.1-1.fc17.x86_64
cyrus-sasl-gssapi-2.1.23-31.fc17.x86_64
server (centos 6, all updates):
cyrus-imapd-2.3.16-6.el6_2.5.x86_64
cyrus-sasl-gssapi-2.1.23-13.el6_3.1.x86_64
Comment 4 Kevin Ottens 2013-11-16 07:28:12 UTC
The IMAP resource has a new maintainer, reassigning to him.
Comment 5 Denis Kurz 2016-09-24 20:40:44 UTC
This bug has only been reported for versions older than KDEPIM 4.14 (at most akonadi-1.3). Can anyone tell if this bug still present?

If noone confirms this bug for a recent version of akonadi (part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 6 markus hetzenecker 2016-11-09 12:48:40 UTC
tested again, failed again.

client (fedora 24):
kmail-16.08.2-1.fc24.x86_64
kdepim-runtime-16.08.2-1.fc24.x86_64
server (centos 6):
cyrus-imapd-2.3.16-13.el6_6.x86_64
cyrus-sasl-gssapi-2.1.23-15.el6_6.2.x86_64

procedure:
new installation with fedora 24, update of system, join to IPA (centos6).
login as user with new created local home directory.
configure kmail for incoming mails via imap and GSSAPI.
access to email folders works.
send email to the account.

the new email just show up after update (F5) the email folder.

Expected Results:  
kmail shows "new mail"
Comment 7 Denis Kurz 2017-01-08 00:14:25 UTC
Confirmed due to comment 6
Comment 8 Daniel Vrátil 2017-04-18 23:05:40 UTC
Git commit 61bee84d8afc42576d309a616c3894f18c1b964f by Daniel Vrátil.
Committed on 18/04/2017 at 23:05.
Pushed by dvratil into branch 'Applications/17.04'.

[IMAP] Fix IDLE support with GSSAPI authentication

Only ignore IDLE due to empty password when not using GSSAPI.
With GSSAPI the password field in settings is always empty.
FIXED-IN: 5.5.1

M  +3    -1    resources/imap/imapresourcebase.cpp

https://commits.kde.org/kdepim-runtime/61bee84d8afc42576d309a616c3894f18c1b964f