#1486742 closed Bugs (fixed)
function set_threading() incorrectly setting REFS instead of REFERENCES algorithm
| Reported by: | crazyfool2100 | Owned by: | |
|---|---|---|---|
| Priority: | 2 | Milestone: | 0.4-stable |
| Component: | IMAP connection | Version: | 0.4-beta |
| Severity: | major | Keywords: | |
| Cc: |
Description
My IMAP server capability string lists THREAD=REFERENCES but NOT THREAD=REFS, but the function set_threading() in /program/include/rcube_imap.php still sets my threading command to REFS. This creates errors.
As a result, my inbox is empty when I turn on threading mode and the following is the imap_debug log:
[17-May-2010 13:44:56 -0700]: C: thrd1 THREAD REFS US-ASCII ALL
[17-May-2010 13:44:56 -0700]: S: thrd1 BAD Error in IMAP command THREAD: Unknown thread algorithm.
Since my server doesn't support REFS, the command that should be used is 'thrd1 THREAD REFERENCES US-ASCII ALL'.
Here are my IMAP server capabilities:
CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS LIST-EXTENDED I18NLEVEL=1 QUOTA
When I change the function to respond with "REFERENCES" even if "REFS" is 'detected', the threading works:
function set_threading($enable=false)
{
$this->threading = false;
if ($enable) {
if ($this->get_capability('THREAD=REFS'))
$this->threading = 'REFERENCES';
else if ($this->get_capability('THREAD=REFERENCES'))
$this->threading = 'REFERENCES';
else if ($this->get_capability('THREAD=ORDEREDSUBJECT'))
$this->threading = 'ORDEREDSUBJECT';
}
return $this->threading;
}
So, ultimately there is an error with how rcube detects which threading algorithm to use. Even when THREAD=REFS doesn't exist but THREAD=REFERENCES does, rcube still uses the REFS algorithm.
Change History (4)
comment:1 follow-up: ↓ 2 Changed 3 years ago by alec
- Milestone changed from later to 0.4-stable
comment:2 in reply to: ↑ 1 Changed 3 years ago by crazyfool2100
I discovered the problem. For some reason, my mail server sends a COMPATIBILITY string with both REFS and REFERENCES before logging in with my user, but AFTER logging in with my account, the CAPABILITY string only shows REFERENCES. So rcube uses REFS when it doesn't appear to be supported for my particular user account.
I am not sure if the IMAPrev4 standards allow for varying capabilities per user, but if they do, then I assume rcube should check for threading capabilities after logging in with a user account. Otherwise, this is just a unique error with my imap server that is against the standards.
IMAP_LOG:
--------------------------------------------
[18-May-2010 03:48:09 -0700]: S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR
LOGIN-REFERRALS ID ENABLE AUTH=PLAIN] Server ready imap.xxx.com
[18-May-2010 03:48:09 -0700]: C: cp01 CAPABILITY
[18-May-2010 03:48:09 -0700]: S: * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR
LOGIN-REFERRALS ID ENABLE SORT
SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND
UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED
I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES
WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA AUTH=PLAIN
[18-May-2010 03:48:09 -0700]: S: cp01 OK Capability completed.
[18-May-2010 03:48:09 -0700]: C: a001 LOGIN "xxx@xxx.com" "xxxxxx"
[18-May-2010 03:48:09 -0700]: S: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES
MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE
LOGIN-REFERRALS UIDPLUS LIST-EXTENDED I18NLEVEL=1 QUOTA
AUTH=PLAIN
[18-May-2010 03:48:09 -0700]: S: a001 OK Logged in.
[18-May-2010 03:48:09 -0700]: C: sel1 SELECT "INBOX"
[18-May-2010 03:48:09 -0700]: S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
[18-May-2010 03:48:09 -0700]: S: * OK [PERMANENTFLAGS (\Answered \Flagged
\Deleted \Seen \Draft \*)] Flags permitted.
[18-May-2010 03:48:09 -0700]: S: * 6 EXISTS
[18-May-2010 03:48:09 -0700]: S: * 0 RECENT
[18-May-2010 03:48:09 -0700]: S: * OK [UIDVALIDITY 1274141083] UIDs valid
[18-May-2010 03:48:09 -0700]: S: * OK [UIDNEXT 18] Predicted next UID
[18-May-2010 03:48:09 -0700]: S: sel1 OK [READ-WRITE] Select completed.
[18-May-2010 03:48:09 -0700]: C: thrd1 THREAD REFS US-ASCII ALL
[18-May-2010 03:48:09 -0700]: S: thrd1 BAD Error in IMAP command THREAD:
Unknown thread algorithm.
[18-May-2010 03:48:09 -0700]: C: lsb LSUB "INBOX." "*"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.Inbox"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.spam"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.Trash"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.Drafts"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.Sent"
[18-May-2010 03:48:09 -0700]: S: * LSUB () "." "INBOX.INBOX.Inbox"
[18-May-2010 03:48:09 -0700]: S: lsb OK Lsub completed.
[18-May-2010 03:48:09 -0700]: C: QUOT1 GETQUOTAROOT "INBOX"
[18-May-2010 03:48:09 -0700]: S: * QUOTAROOT "INBOX" ""
[18-May-2010 03:48:09 -0700]: S: * QUOTA "" (STORAGE 7574 10485760)
[18-May-2010 03:48:09 -0700]: S: QUOT1 OK Getquotaroot completed.
[18-May-2010 03:48:09 -0700]: C: I LOGOUT
TELNET LOG (Capability before logging in):
--------------------------------------------
==> telnet imap.xxx.com 143
Trying xxx.xxx.xxx.xxx...
Connected to imap.xxx.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID
ENABLE STARTTLS AUTH=PLAIN] Server ready imap.xxx.com
==> 01 CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS
ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS
MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS
LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT
SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA
STARTTLS AUTH=PLAIN
01 OK Capability completed.
TELNET LOG (Capability AFTER logging in):
--------------------------------------------
==> telnet imap.xxx.com 143
Trying xxx.xxx.xxx.xxx...
Connected to imap.xxx.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS
ID ENABLE STARTTLS AUTH=PLAIN] Server ready imap.xxx.com
==> A LOGIN xxx@xxx.com xxxx
A OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES
MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE
LOGIN-REFERRALS UIDPLUS LIST-EXTENDED I18NLEVEL=1
QUOTA AUTH=PLAIN] Logged in.
==> 01 capability
* CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND
UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS
UIDPLUS LIST-EXTENDED I18NLEVEL=1 QUOTA
01 OK Capability completed.
comment:3 Changed 3 years ago by alec
- Resolution set to fixed
- Status changed from new to closed
[1d51658b] should fix your issue. You can also enable imap_force_caps option.
comment:4 Changed 3 years ago by alec
... with fix in [6a86d272].

Strange. This is not true for me. Could you attach complete debug log?