View Single Post
  #2  
Old 24th July 2006, 19:38
Davide Davide is offline
Senior Member
 
Join Date: Jul 2006
Posts: 123
Thanks: 16
Thanked 9 Times in 8 Posts
Default Make roundcube create all needed folders

I think this is far better solution:

Create a text file in /home/admispconfig/ispconfig/web/roundcubemail (for example patch.diff)
with the following content:

--- program/include/rcube_imap.inc (revision 260)
+++ program/include/rcube_imap.inc (working copy)
@@ -362,13 +362,18 @@
if (!is_array($a_folders) || !sizeof($a_folders))
$a_folders = array();

- // create INBOX if it does not exist
- if (!in_array_nocase('INBOX', $a_folders))
+ // create Default folders if they do not exist
+ global $CONFIG;
+ foreach ($CONFIG['default_imap_folders'] as $folder)
{
- $this->create_mailbox('INBOX', TRUE);
- array_unshift($a_folders, 'INBOX');
+ if (!in_array_nocase($folder, $a_folders))
+ {
+ $this->create_mailbox($folder, TRUE);
+ $this->subscribe($folder);
+ }
}

+ $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter);
$a_mailbox_cache = array();

// write mailboxlist to cache


patch roundcube mail:

machine:/home/admispconfig/ispconfig/web/roundcubemail# patch -p0 < patch.diff

And... voilą!

Every user who log in roundmail, get all needed folders created (not only Trash)
Reply With Quote