[imp] HEAD: getDelimiter oddities, bug?

Leena Heino Leena.Heino at uta.fi
Wed Jan 15 19:07:30 PST 2003


On Wed, 15 Jan 2003, Chuck Hagenbuch wrote:

> Quoting Leena Heino <Leena.Heino at uta.fi>:
>
> > It seems that if I have only INBOX and this mailbox does not have
> > childer then getDelimiter is unable to get delimiter and uses the default
> > value. The default delimiter "/" does not work with Cyrus, which expects
> > to use "." as delimiter.
> >
> > What is the correct way of fixing this feature with getDelimiter?
>
> Dunno - seems like the server should still return the correct one. Play
> around with the function and see if you can get it to return the right thing.
>
If I have folders='' and namespace='INBOX.' it seems that the following
line in getDelimiter function:
$box = imap_getmailboxes($stream, IMP::serverString(), IMP::addPreambleString('%'));

gets translated to:
$box = imap_getmailboxes($stream, 'some_server_string', 'INBOX.%'));

This means that imap_getmailboxes returns no mailboxes and default
delimiter value is always used everywhere.

Therefore I suggest the the line in getDelimiter should be changed to:
$box = @imap_getmailboxes($stream, IMP::serverString(), IMP::addPreambleString(''));

This bug/feature is present in both RELENG and HEAD versions.

Patch attached.

> -chuck

-- 
  -- Leena Heino (liinu at uta.fi)-------------- next part --------------
--- imp/lib/Folder.php.orig	Mon Jan 13 09:56:53 2003
+++ imp/lib/Folder.php	Wed Jan 15 19:01:34 2003
@@ -656,7 +656,7 @@
     function getDelimiter($stream, $default = '/')
     {
         if (is_null($this->_delimiter)) {
-            $box = @imap_getmailboxes($stream, IMP::serverString(), IMP::addPreambleString('%'));
+            $box = @imap_getmailboxes($stream, IMP::serverString(), IMP::addPreambleString(''));
             $this->_delimiter = !empty($box[0]->delimiter) ? $box[0]->delimiter : $default;
         }
 


More information about the imp mailing list