Hello everyone!
I was wondering, why my Roundcube instance wouldn't show the quota bar, turns out that there is a problem with detecting IMAP capabilities in the RC code. And looks like I'm not the only one: http://trac.roundcube.net/ticket/1485750
In short, our mail cluster setup doesn't return the full set of IMAP capabilities before the user has been logged in.
Our setup (RC 0.3.1-20091031):
Webmail front-end | mail cluster RC -> imapproxy -> perdition -> courier imap
Here is what an IMAP connection looks like from the webmail box:
root@webmail:/# nc 127.0.0.1 143
C: CAPABILITY
C: OK Completed C: LOGIN rudolfs@sigmanet.lv xxx C: OK User logged in C: CAPABILITY
THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION C: OK CAPABILITY completed
But when logging in with roundcube I get the following (using xdebug):
public 'capability' => array 0 => string 'IMAP4' (length=5) 1 => string 'IMAP4REV1' (length=9) 2 => string 'XIMAPPROXY' (length=10)
After a little poking around in the Iloha IMAP library, I came up with this hack:
root@webmail:/var/www/rc# git diff program/lib/imap.inc diff --git a/program/lib/imap.inc b/program/lib/imap.inc index 9d896ff..6df5855 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -452,6 +452,7 @@ function iil_C_Login(&$conn, $user, $password) { if ($result == 0) { $conn->error .= ''; $conn->errorNum = 0;
iil_C_ClearCapability($conn);
return $conn->fp;
}It clears the capability array after a successful login. After logging in with this change I get:
public 'capability' => array 0 => string 'IMAP4REV1' (length=9) 1 => string 'UIDPLUS' (length=7) 2 => string 'CHILDREN' (length=8) 3 => string 'NAMESPACE' (length=9) 4 => string 'THREAD=ORDEREDSUBJECT' (length=21) 5 => string 'THREAD=REFERENCES' (length=17) 6 => string 'SORT' (length=4) 7 => string 'QUOTA' (length=5) 8 => string 'IDLE' (length=4) 9 => string 'ACL' (length=3) 10 => string 'ACL2=UNION' (length=10)
And the quota bar is working. Also this bug could be responsible for the IMAP SORT feature not working on my setup...
Your thoughts?
Regards, Rudolfs
List info: http://lists.roundcube.net/dev/
Rudolfs Osins wrote:
I was wondering, why my Roundcube instance wouldn't show the quota bar, turns out that there is a problem with detecting IMAP capabilities in the RC code. And looks like I'm not the only one: http://trac.roundcube.net/ticket/1485750
root@webmail:/var/www/rc# git diff program/lib/imap.inc diff --git a/program/lib/imap.inc b/program/lib/imap.inc index 9d896ff..6df5855 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -452,6 +452,7 @@ function iil_C_Login(&$conn, $user, $password) { if ($result == 0) { $conn->error .= ''; $conn->errorNum = 0;
}iil_C_ClearCapability($conn); return $conn->fp;
For clarity we should do this at the end of iil_C_Connect() before iil_C_Namespace() call. I also think this should be optional, because in most cases (no proxy) we don't need to renew capabilities. I'll work on this.
On Wed, 2010-03-24 at 11:27 +0100, A.L.E.C wrote:
Rudolfs Osins wrote:
I was wondering, why my Roundcube instance wouldn't show the quota bar, turns out that there is a problem with detecting IMAP capabilities in the RC code. And looks like I'm not the only one: http://trac.roundcube.net/ticket/1485750
root@webmail:/var/www/rc# git diff program/lib/imap.inc diff --git a/program/lib/imap.inc b/program/lib/imap.inc index 9d896ff..6df5855 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -452,6 +452,7 @@ function iil_C_Login(&$conn, $user, $password) { if ($result == 0) { $conn->error .= ''; $conn->errorNum = 0;
}iil_C_ClearCapability($conn); return $conn->fp;
For clarity we should do this at the end of iil_C_Connect() before iil_C_Namespace() call. I also think this should be optional, because in most cases (no proxy) we don't need to renew capabilities. I'll work on this.
Would be nice if one could set this in the configuration for example: $rcmail_config['imap_cap_after_login'] = TRUE;
Thanks! R.
List info: http://lists.roundcube.net/dev/
On Wed, 24 Mar 2010 13:05:45 +0200, Rudolfs Osins rudolfs.osins@sigmanet.lv wrote:
On Wed, 2010-03-24 at 11:27 +0100, A.L.E.C wrote:
Rudolfs Osins wrote:
I was wondering, why my Roundcube instance wouldn't show the quota
bar,
turns out that there is a problem with detecting IMAP capabilities in the RC code. And looks like I'm not the only one: http://trac.roundcube.net/ticket/1485750
root@webmail:/var/www/rc# git diff program/lib/imap.inc diff --git a/program/lib/imap.inc b/program/lib/imap.inc index 9d896ff..6df5855 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -452,6 +452,7 @@ function iil_C_Login(&$conn, $user, $password) { if ($result == 0) { $conn->error .= ''; $conn->errorNum = 0;
}iil_C_ClearCapability($conn); return $conn->fp;
For clarity we should do this at the end of iil_C_Connect() before iil_C_Namespace() call. I also think this should be optional, because
in
most cases (no proxy) we don't need to renew capabilities. I'll work on
this.
Would be nice if one could set this in the configuration for example: $rcmail_config['imap_cap_after_login'] = TRUE;
Thanks! R.
Looks like you got your wish: http://trac.roundcube.net/changeset/3415
-Albert
List info: http://lists.roundcube.net/dev/