[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twig-devel
Subject:    RE: [twig-devel] Mailtree problems
From:       "Greg Ross" <greg () darkphoton ! com>
Date:       2000-11-28 19:31:28
[Download RAW message or body]


	Thanks, I've update the cvs tree...

							Greg

> -----Original Message-----
> From: Roland Pope [mailto:rpope@jade.co.nz]
> Sent: Wednesday, November 15, 2000 8:49 PM
> To: twig-devel@screwdriver.net
> Subject: Re: [twig-devel] Mailtree problems
> 
> 
> I have coded myself a workaround to this problem if anyone is
> interested.
> Basically you have to keep a separate array of all the nodes you have
> added to the mailtree.
> Whenever you process a folderlist entry from the server, you check all
> the nodes in the folder name to see if you have already added the node
> to the mailtree. You also have to compare the location of the given node
> in the tree structure to check if a given nodename was found in a
> different location (Eg if checking for a node called 'Folder',
> INBOX.Folder is not the same node as user.Folder). If you haven't seen
> this node in this context before you add it to the mailtree.
> If the node you are adding is not the last node of the folder, then
> don't make it a link as we don't have access to the node (This relies on
> the mailbox sort which means that INBOX will be added to the mailtree
> before INBOX.Folder if we have access to INBOX)
> I have included below the changes I made to the TreeLoadMailboxList
> function in mail.inc.php3
> 
> <Code Starts here>
>  $treecnt = 1;
>  for( $i = 1, $j = count( $mblist ) + 1; $i < $j; $i++ )
>   {
>   $data = TWIGMailParseFolderString( $mblist[$i-1] );
>   list( $depth, $hiarch ) = TWIGMailExpandFolderStructure( $data[3] );
>   $others[0] = array( "item"=>"mailbox", "value"=>$data[3]);
>   for ($i2 = 0;$i2 <= $depth;$i2++)
>    {
>    if ($nodecheck) { $nodecheck .= $config["mail_folder_delimiter"] .
> $hiarch[$i2]; }
>     else{$nodecheck .= $hiarch[$i2];}
>    if ((!$storedlevels[$hiarch[$i2]]) or (!ereg("^" .
> $nodecheck,$storedlevels[$hiarch[$i2]])))
>     {
>     $storedlevels[$hiarch[$i2]] = $data[3];
>     $tree[$treecnt][0] = $i2 + 2;
>     $tree[$treecnt][1] = "<font size=-1>" . $hiarch[$i2] . "</font>";
>     if ($depth == $i2){ $tree[$treecnt][2] = $first . TWIGSession(
> "get", $others ) . $last; }
>     $tree[$treecnt][3] = "";
>     $tree[$treecnt][4] = 0;
>     $treecnt ++;
>     }
>    }
>    $nodecheck = "";
>    if( $maxlevel < ( $depth + 3 ) ) { $maxlevel = $depth + 3; }
>   }
> <Code Ends Here>
> "Roland Pope" <rpope@jade.co.nz>  said
> > I can see the folders correctly in the folders listbox on the main
> mail
> > screen as well as in the lists on the folder managment screen.
> > From looking at the code, I think the following is happening.
> >
> > 1) Take two users USERA and USERB. USERA has shared his folder called
> > 'SHARED' with USERB.
> > 2) USERB logs onto twig and subscribes to the folder in the list
> called
> > 'user.USERA.SHARED'
> > 3) When he goes to the main mail screen, the newly subscribed to
> folder
> > shows up correcly in the folder dropdown box, but the mailtree
> displays
> > it as 'USERA.SHARED', a subfolder of INBOX.
> >
> > This happens because 'user' and 'user.USERA' are not listed as
> seperate
> > entries when you do a LSUB to the IMAP server, hence the mailtree code
> > doesn't correctly build the heirachy for them.
> > The problem is even worse if a given user has no access rights to
> their
> > own INBOX but can see all their subfolders. The mailtree shows nothing
> > in such a case.
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic