Well, its been a while since I've been doing Squirrelmail coding (I originally wrote the NewMail plugin long,long ago), but it seems that I've had to break out my php skills again for some hacking fun :)
We've just recently started to migrate a number of our mail servers over to the dovecot IMAP server from the older wu-imap servers (we're still keeping the mbox mail format -- don't bug me about that one). While the new dovecot worked just fine for our Mozilla users, we (or mainly, I) had a problem with the Squirrelmail handling of the folders.
All folders that contain sub-folders would show up twice in the left-hand pane. Additionally, these folders would NOT show up in the list of folders you could add a new folders to. Seems like something goofy in the folder handler, and I managed to hack up some changes to the functions/imap_mailbox.php code to get it working. I've created a new imap server type 'dovecot' that handles these issues with appropriate code changes so hopefully these don't break other installations. Below is a patch file showing the changes I made.
Let me know if this helps anyone or if I'm going totally down the wrong path here. I can provide some help or assistance if needed to reproduce the issues we were having.
Thanks again for a great product!
Michael Huttinger Software Engineer
------------------------- PATCH -------------------------
diff -Naur squirrelmail_orig/functions/imap_mailbox.php squirrelmail/functions/imap_mailbox.php
--- squirrelmail_orig/functions/imap_mailbox.php 2003-11-19 12:51:09.000000000 -0600
+++ squirrelmail/functions/imap_mailbox.php 2003-11-19 12:53:16.000000000 -0600
@@ -430,7 +430,14 @@
$boxes = sqimap_mailbox_list($imap_stream);
}
foreach ($boxes as $boxes_part) {
- if (!in_array('noselect', $boxes_part['flags'])) {
+
+ if($imap_server_type = 'dovecot')
+ $flg = in_array('children',$boxes_part['flags']) ||
+ !in_array('noselect', $boxes_part['flags']);
+ else
+ $flg = !in_array('noselect', $boxes_part['flags']);
+
+ if($flg) {
$box = $boxes_part['unformatted'];
$lowerbox = strtolower($box);
@@ -498,7 +505,10 @@
}
}
$temp_mailbox_name = find_mailbox_name($lsub_ary[$i]);
- $sorted_lsub_ary[] = $temp_mailbox_name;
+ if(substr($temp_mailbox_name,-1) != $delimiter &&
+ $imap_server_type!='dovecot') {
+ $sorted_lsub_ary[] = $temp_mailbox_name;
+ }
if (!$inbox_subscribed && strtoupper($temp_mailbox_name) == 'INBOX') {
$inbox_subscribed = true;
}
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ -- squirrelmail-users mailing list List Address: [EMAIL PROTECTED] List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995 List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
