roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.93k stars 1.65k forks source link

Add support for shared folders - patch #525

Closed rcubetrac closed 14 years ago

rcubetrac commented 18 years ago

Reported by geeojr on 12 Jan 2006 01:53 UTC as Trac ticket #1403507

I can't see shared folders with Courier. Courier-imap makes shared folders available at the root level. Root level contains: INBOX. & shared. -- need to check for both.

Migrated-From: http://trac.roundcube.net/ticket/1403507

rcubetrac commented 18 years ago

Comment by harrinp1 on 22 Jun 2006 12:28 UTC

I also vote for this feature. Diffrent IMAP servers handle this diffrently so you need to check the namespace to find out the Public folder namespace.

rcubetrac commented 18 years ago

Severity changed by harrinp1 on 22 Jun 2006 12:28 UTC

=> normal

rcubetrac commented 17 years ago

Comment by captainmish on 15 Dec 2006 09:55 UTC

another vote here - there are a number of installations that rely heavily on shared folders, thus making roundcube a non-starter for them.

rcubetrac commented 17 years ago

Comment by thesubmitter on 11 Jan 2007 04:38 UTC

I also vote for this. For me this is a deal breaker for roundcube.

rcubetrac commented 17 years ago

Comment by zzamboni on 20 Mar 2007 12:29 UTC

Here's another vote - this would be tremendously useful.

rcubetrac commented 17 years ago

Comment by jvale on 30 Apr 2007 16:34 UTC

Here here! This feature is essential so that I can deploy RoundCube at the site I'm adminning.

Eventough it's a bit of an ugly hack, the patch works like a charm with a Courier server.

rcubetrac commented 17 years ago

Comment by jvale on 30 Apr 2007 16:55 UTC

Correction: the hack doesn't work that well. I can see the shared folders, but 'special' folders like Drafts, Trash and Sent are no longer 'special'. Meaning, I can't delete messages and it fails when copying a message I just sent to the 'Sent' folder.

rcubetrac commented 17 years ago

Comment by mbalex on 5 May 2007 13:25 UTC

jvale is correct if you dont change anything else. since the default root dir is "INBOX" on courier all special folders are usally relative to "INBOX" defined. since this hack changes the default root dir to "", the special folders etc need to prefix "INBOX." .

$rcmail_config[= 'INBOX.Drafts';

$rcmail_config'junk_mbox' = 'INBOX.Junk';

$rcmail_config[= 'INBOX.Sent';

$rcmail_config'trash_mbox' = 'INBOX.Trash';

$rcmail_config['default_imap_folders'] = array('INBOX', 'INBOX.Drafts', 'INBOX.Sent', 'INBOX.Junk', 'INBOX.Trash');

rcubetrac commented 16 years ago

Summary changed by seansan on 17 Feb 2008 09:24 UTC

Add support for shared folders

Add support for shared folders - patch

rcubetrac commented 16 years ago

Milestone changed by @thomascube on 9 Mar 2008 16:15 UTC

=> 0.4-beta

rcubetrac commented 14 years ago

Comment by @thomascube on 18 Feb 2010 18:24 UTC

Marked #1484043 as a duplicate of this bug

rcubetrac commented 14 years ago

Status changed by @thomascube on 18 Feb 2010 18:24 UTC

assigned => new

rcubetrac commented 14 years ago

Owner changed by @thomascube on 18 Feb 2010 18:24 UTC

roundcube => thomasb

rcubetrac commented 14 years ago

Comment by @thomascube on 23 Feb 2010 12:39 UTC

Another patch for shared folders: http://lists.roundcube.net/mail-archive/dev/2010-02/0000015.html

rcubetrac commented 14 years ago

Status changed by @thomascube on 23 Feb 2010 12:39 UTC

new => assigned

rcubetrac commented 14 years ago

Comment by gordonjahn on 31 Mar 2010 15:22 UTC

I've reviewed the patches and suggestions for getting shared folders working with RC but didn't like changing the Ilohamail library.

I've taken an alternative approach in the attached sharedpatch.txt patch -- the underlying library isn't modified as it works fine. Instead, imap_root is set in the config like this:

$rcmail_config['imap_root'] = array('INBOX', 'shared');

If this isn't set to an array('INBOX') by default, things stop working. I'm not sure if that should be handled in the config section though.

Anyway, after setting this and applying the patch, the mod_mailbox() function in rcube_imap.php is the main one that needs attention to ensure it doesn't mess with the folder names wrongly and the list_unsubscribed function is modified to check all the roots specified in the config file.

This seems to work for me, but wider testing might be nice, and this approach might be useful for others.

rcubetrac commented 14 years ago

Comment by gordonjahn on 31 Mar 2010 20:45 UTC

I've attached an updated version of my patch from earlier - moving messages into and out of shared folders wasn't working, which is resolved now, and the need to configure has been removed. With the patch added, RC will work as normal is imap_root is not set (as default) and if the imap_root setting is set as detailed above, shared folder support works too.

rcubetrac commented 14 years ago

Comment by @alecpl on 2 Apr 2010 12:02 UTC

I think shared folders should be supported using NAMESPACE extension. Could you guys create a test IMAP account for me on server with shared folders configured? I would like to work on this but, have no testing environment.

rcubetrac commented 14 years ago

Comment by etiennesw on 28 Apr 2010 12:47 UTC

Hi gordonjahn,

I am trying to setup Roundcube with the courier-imap server we use.

Would you be kind enough to give me instructions on how to install your patch for shared folders?

Where do we apply the code found in your text file?

Thanks

Rgs Etienne

rcubetrac commented 14 years ago

Comment by gordonjahn on 28 Apr 2010 13:10 UTC

Etienne..

The file is a unified patch file which you could apply the patch by using the patch utility inside a Bash shell - these programs should be on most Unix/Linux/Mac systems already or, for Windows, install them using something like Cygwin. The process to enable would then be something like:

Having done this, shared folders should work if enabled on the mail server. The final configuration line above is for the Courier IMAP mail server which uses the shared namespace for shared folders. If you don't have this set up already, I configured Courier for shared folders using the (vague) instructions at http://www.courier-mta.org/imap/README.sharedfolders.html .

This has a lot of background info, but it come down to using the maildirmake command with different options to set up the shared folders and then to make them available for each user - see the docs for this command if you need to use it.

Hope that helps, Gordon

rcubetrac commented 14 years ago

Comment by etiennesw on 28 Apr 2010 14:15 UTC

Hi Gordon,

I successfully applied the patch as you said and also set the imap_root = array('INBOX','#shared') since our prefix is #shared. In roundcube the #shared folder appears, but is empty and cannot be subscribed to.

The shared folders on our courier-imap server were created via maildirmake and work well with Thunderbird and Horde webmail, however, Roundcube is proving to be problamatic with public shared folders.

Thanks anyway for your help.

Rgs Etienne

rcubetrac commented 14 years ago

Comment by etiennesw on 29 Apr 2010 11:25 UTC

Hi Gordon,

I managed to get the shared folders to work in Roundcube. After applying your patch I had to define every shared folder in the main.inc.php file as part of the arrary.

$rcmail_config['imap_root'] = array('INBOX','#shared.folder1, #shared.folder2, #shared.folder3);

Thanks

Rgs Etienne

rcubetrac commented 14 years ago

Comment by gordonjahn on 29 Apr 2010 11:32 UTC

That's really weird - I just did the prefix and then could configure them using the usual IMAP subscription configuration page.

That said, if it works, great!

rcubetrac commented 14 years ago

Milestone changed by @thomascube on 21 May 2010 20:26 UTC

0.4-stable => 0.5-beta

rcubetrac commented 14 years ago

Comment by brandond on 10 Aug 2010 06:11 UTC

Alec - do you still want a test server with namespace support? I've got Dovecot boxes coming out my ears, and would be glad to set one aside for you to bash on.

rcubetrac commented 14 years ago

Comment by @alecpl on 10 Aug 2010 06:23 UTC

Yes, I need only an account with configured some namespaces. I'd like to connect to it from my box. Currently I'm a little busy, but I could do some tests later in this month. Write to alec at alec dot pl.

rcubetrac commented 14 years ago

Comment by combatwombat on 10 Aug 2010 10:13 UTC

Hi .. not sure who ....

I can see that this functionality is planned/going to be put into the mainstream code in 0.5beta, however this lack of capability is the most important issue in RC, it is stopping me from converting 200 users off squirrelmail (cyrus backend). SM, Hastymail and everyone else supports it, but RC doesnt.. can it be bought forward, I think a lot of potential users are just waiting for this and they will throw the switch.

Rgds John

rcubetrac commented 14 years ago

Severity changed by combatwombat on 10 Aug 2010 10:13 UTC

normal => major

rcubetrac commented 14 years ago

Milestone changed by combatwombat on 10 Aug 2010 10:13 UTC

0.5-beta => 0.4.1

rcubetrac commented 14 years ago

Comment by @alecpl on 10 Aug 2010 17:26 UTC

This is "lack of capability", not a bug. Please, don't change the milestone.

rcubetrac commented 14 years ago

Milestone changed by @alecpl on 10 Aug 2010 17:26 UTC

0.4.1 => 0.5-beta

rcubetrac commented 14 years ago

Comment by kaz on 11 Aug 2010 18:35 UTC

Has anyone rediffed this patch against 0.4?

rcubetrac commented 14 years ago

Comment by glen on 28 Aug 2010 16:05 UTC

i've rediffed against 0.4, works for me:

$rcmail_config['imap_root'] = array('INBOX', 'shared');

using courier-imap 4.8.0

http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/roundcubemail/shared-folders.patch?rev=1.3

rcubetrac commented 14 years ago

Comment by @alecpl on 28 Oct 2010 15:23 UTC

I've prepared a patch for svn-trunk. On servers with NAMESPACE support no configuration is required. On servers without NAMESPACE support you'll need to set imap_personal (old imap_root) and imap_shared options.

rcubetrac commented 14 years ago

Comment by pawelz on 28 Oct 2010 20:26 UTC

It breaks my roundcube installation. I tested it on PLD Linux, version posted by glen (http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/roundcubemail/shared-folders.patch?rev=1.3).

Since I applied this patch I'm able to acces only inbox. All other, shared and private, folders are gone.

Also I don't understand what exactly this patch is supposed to do. Shared folders work perfectly for me without this patch.

Please, do not apply this patch.

My environment is:

PS.: Feel free to contact me if you need additional information about my environemnt. I can test new versions of this patch or/and configuration changes.

rcubetrac commented 14 years ago

Comment by pawelz on 28 Oct 2010 21:23 UTC

I added the following line to the config file:

$rcmail_config['imap_root'] = array('');

and now it works again for me.

rcubetrac commented 14 years ago

Comment by @alecpl on 29 Oct 2010 06:13 UTC

The patch is for svn-trunk version and with this patch applied imap_root option doesn't exist. Contact me (alec at alec.pl) if you can provide a test account that I could connect from my box.

rcubetrac commented 14 years ago

Comment by fraggy on 1 Nov 2010 10:26 UTC

Hi [new patch works around 50% ;) Now I can see all shared folders but I don't have access... the folder path is not correct. "Server Error: STATUS: Mailbox doesn't exist:"

We are using dovecot mailserver. All shares are stored in Maildir/shared/from.user/.... [BR] like: shared/max.muster/.testshare or shared/max.muster/.testshare.sub1 [new patch is searching for: shared.max\2emuster.testshare or shared.max\2emuster.testshare.sub1 [BR]

These search strings are correct for all "normal" folders but not for shared folders! [normal folder hierarchy separator is a dot and a dot in the foldername has the string "\2e" as separator

So what I need is [BR] shared/user.who.shares/.sharedfolders.maybewithsub instead of [[BR]] shared.user\2ewho\2eshares.sharedfolders.maybewithsub

feel free to ask me, if you don't understand my confusing description :D

rcubetrac commented 14 years ago

Comment by @alecpl on 2 Nov 2010 07:31 UTC

@fraggy: what do you have in imap_delimiter, imap_personal and imap_shared options? Does your server support NAMESPACE extension? Enable imap_debug and attach the log (or send it to me).

rcubetrac commented 14 years ago

Comment by fraggy on 2 Nov 2010 12:47 UTC

main.inc.php

$rcmail_config[= '/';
$rcmail_config['imap_personal']('imap_delimiter']) = NULL; 
$rcmail_config[= NULL;

dovecot config

namespace private {
   separator = /
   prefix = INBOX/
   ....
}

namespace shared {
   separator = /
   # %%n, %%d and %%u are expanded to the destination user.
   prefix = shared/%%u/
   # List the shared/ namespace only if there are visible shared mailboxes.
   list = children
   ....
}

imap log

[02-Nov-2010 13:33:54 +0100]('imap_shared']): C: A0023 STATUS INBOX/shared/adam.marsch (UNSEEN)
[13:33:54 +0100](02-Nov-2010): S: A0023 NO Mailbox doesn't exist: shared.adam\2emarsch
[13:33:54 +0100](02-Nov-2010): C: A0024 SELECT INBOX/shared/adam.marsch
[13:33:54 +0100](02-Nov-2010): S: A0024 NO Mailbox doesn't exist: shared.adam\2emarsch
[13:33:54 +0100](02-Nov-2010): C: A0025 STATUS INBOX/shared/adam.marsch/testshare (UNSEEN)
[13:33:54 +0100](02-Nov-2010): S: A0025 NO Mailbox doesn't exist: shared.adam\2emarsch.testshare
[13:33:54 +0100](02-Nov-2010): C: A0026 SELECT INBOX/shared/adam.marsch/testshare
[13:33:54 +0100](02-Nov-2010): S: A0026 NO Mailbox doesn't exist: shared.adam\2emarsch.testshare
[13:33:54 +0100](02-Nov-2010): C: A0027 STATUS INBOX/shared/adam.marsch/testshare/subfolder1 (UNSEEN)
[13:33:54 +0100](02-Nov-2010): S: A0027 NO Mailbox doesn't exist: shared.adam\2emarsch.testshare.subfolder1
[13:33:54 +0100](02-Nov-2010): C: A0028 SELECT INBOX/shared/adam.marsch/testshare/subfolder1
[13:33:54 +0100](02-Nov-2010): S: A0028 NO Mailbox doesn't exist: shared.adam\2emarsch.testshare.subfolder1

correct values are shared/adam.marsch ; shared/adam.marsch/.testshare ; shared/adam.marsch/.testshare.subfolder1

rcubetrac commented 14 years ago

Comment by @alecpl on 2 Nov 2010 13:36 UTC

I'd like to see, what is returned for NAMESPACE command.

rcubetrac commented 14 years ago

Comment by fraggy on 2 Nov 2010 14:40 UTC

something like this?

[13:33:54 +0100](02-Nov-2010): S: * NAMESPACE (("INBOX/" "/")) (("shared/" "/")) NIL

I'll delete all privat log entries and send the log file to you

rcubetrac commented 14 years ago

Comment by @alecpl on 2 Nov 2010 14:57 UTC

Here's the problem. My patch works only with personal and public namespaces. It doesn't work with shared (others). I'll work on this.

rcubetrac commented 14 years ago

Comment by @alecpl on 2 Nov 2010 14:58 UTC

BTW, you could check with imap_shared="shared/" and imap_personal="INBOX/".

rcubetrac commented 14 years ago

Comment by fraggy on 3 Nov 2010 08:50 UTC

had no luck with imap_shared and imap_personal :/

rcubetrac commented 14 years ago

Comment by @alecpl on 3 Nov 2010 08:57 UTC

Because namespace/delimiter settings are cached in session, you'll need to re-login after config changes. Write to alec at alec.pl, we'll continue there. Please, do logout, clear the log, and login. Sent me the complete log.

rcubetrac commented 14 years ago

Comment by @alecpl on 4 Nov 2010 10:39 UTC

I've fixed the patch. @fraggy confirmed it's working for him.

rcubetrac commented 14 years ago

Comment by @alecpl on 9 Nov 2010 07:54 UTC

Patch applied in 00290a60.

rcubetrac commented 14 years ago

Status changed by @alecpl on 9 Nov 2010 07:54 UTC

assigned => closed