[RCD] IMAP ACL plugin + patch

Holger Mauermann holger at mauermann.org
Mon Jan 3 18:19:59 CET 2011


Am 03.01.2011 17:10, schrieb A.L.E.C:
>> --- program/include/rcube_imap_generic.php	(revision 4384)
>> +++ program/include/rcube_imap_generic.php	(working copy)
>> @@ -3224,6 +3224,7 @@
>>      private function parseCapability($str, $trusted=false)
>>      {
>>          $str = preg_replace('/^\* CAPABILITY /i', '', $str);
>> +        $str = preg_replace('/\bRIGHTS=[kxte]{4}\b/i', 'RIGHTS=', $str);
> 
> I don't understand this.

If the IMAP server supports RFC 4314 it must include RIGHTS= followed by
the letters k, x, t and e in its CAPABILITY response. However, they can
appear in any order. Currently e.g. getCapability('RIGHTS=kxte') returns
false if the server response was 'CAPABILITY .. RIGHTS=etxk ..' or so,
because then $capability contains 'RIGHTS=etxk' too.

Above regex simply strips out k, x, t and e and puts only 'RIGHTS=' in
$capability so it's possible to test for RFC 4314 support with
getCapability('RIGHTS=').

Holger
_______________________________________________
List info: http://lists.roundcube.net/dev/
BT/aba52c80



More information about the Dev mailing list