# IMAP shared folders [SOLVED-ISH]

## expat_iain

Does anyone know of a decent howto for Courier-IMAP shared folders?? I've looked around and found various references to Courier, but they're all seeming to be missing parts when it comes to shared folders. I'm trying to gt this whole thing integrated into a MySQL backend, so if there's nothing out there as yet, then I 'll try and document this once completed. It's all part of sorting out a corporate mail system built on Gentoo that will provide functionality of a proprietory mail system without the flakiness.

Regs.

Iain.Last edited by expat_iain on Sat Apr 30, 2005 12:14 pm; edited 1 time in total

----------

## langthang

try https://forums.gentoo.org/viewtopic-p-1441401.html#1441401

----------

## expat_iain

No joy on this so far. Nothing in any logfiles either. Tried to follow some of the links above, but I'm not getting anywhere.

Very simple setup. Exim delivers shared email to /home/vmail/public/dummyacc/ and regular user email to /home/vmail/example.com/username/mail/. All this is defined using MySQL and Exim routers. The mail delivery works great. Picking up user mail via IMAP has no issues either. 

I've added 

```
DEFAULTOPTIONS="disableshared=0"
```

 just to be sure that I'm starting out onthe right foot and then added into /etc/courier-imap/share/index the following line:

```
DUMMYACC        8       12      /home/vmail     /home/vmail/public/engineering/
```

Next up I ran the following:

```
maildiracl -set /home/vmail/public/dummyacc/ INBOX. anyone +li

maildiracl -set /home/vmail/public/dummyacc/ INBOX.new anyone +li

maildiracl -set /home/vmail/public/dummyacc/ INBOX.cur anyone +li
```

Did the extra two, just to be sure.

Checking the listing shows:

```
maildev courier-imap # maildiracl -list /home/vmail/public/dummyacc/ INBOX.       

owner   aceilrstwx

anyone  il
```

Now when I check the shared foldrs via Evolution I get nothing back but my own inbox.

Can someone point me in the right direction for this??

Thanks.

Iain.

----------

## rex123

http://scott.yang.id.au/2003/08/another-look-at-shared-spam-folder-under-courier-imap/ looks quite useful. It has a link to README.sharedfolders as well.

I haven't tried it, but I think I might do now that I've had a look. It could be handy.

----------

## langthang

check it with a telnet client:

```
$ telnet localhost 143

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=LOGIN AUTH=CRAM-MD5 ACL ACL2=UNION STARTTLS]Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING fordistribution information.

a login user@mydomain.com password

a OK LOGIN Ok.

a list "" "#shared.%"

* LIST (\Noselect \HasChildren) "." "#shared.spam@mydomain com"

a OK LIST completed

a logout

* BYE Courier-IMAP server shutting down

a OK LOGOUT completed

Connection closed by foreign host.
```

----------

## expat_iain

As expected, I'm not showing up any shared folders. Does anything in the above help??

```
09:09:31[iain@neteng-iain]$ telnet 10.10.10.10

Trying 10.10.10.10...

Connected to 10.10.10.10.

Escape character is '^]'.

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS XCOURIEROUTBOX=INBOX.Outbox] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.

A LOGIN iain@example.com xxxxxxxx

A OK LOGIN Ok.

A LIST "" "#shared.%"

A OK LIST completed

A LOGOUT

* BYE Courier-IMAP server shutting down

A OK LOGOUT completed

Connection closed by foreign host.
```

Regs.

Iain.

----------

## langthang

```
maildiracl -set /home/vmail/public/dummyacc/ INBOX. anyone +li

maildiracl -set /home/vmail/public/dummyacc/ INBOX.new anyone +li

maildiracl -set /home/vmail/public/dummyacc/ INBOX.cur anyone +li
```

I don't think you can share INBOX itself. Create a folder under INBOX then share that folder.

```
# maildirmake -f Public /home/vmail/public/dummyacc/.maildir

# maildiracl -set /home/vmail/public/dummyacc/ INBOX.Public anyone +li
```

You may want to ask in courier-imap ML http://lists.sourceforge.net/mailman/listinfo/courier-imap

----------

## expat_iain

Tried with the subfolder, but still no joy. Will head off to the Courier mailing list.

Thanks.

Iain.

----------

## rex123

I strongly suspect a permissions problem. I've tried myself now to make both unix-permission-based and virtual shared folders with courier IMAP. I've managed to get both working, but not with ease.

There is a very frustrating lack of logging, (or I don't know how to improve the logging) so it's really hard to know why things aren't working. But I found that virtual shared folders (which are under the #shared namespace) will only work in my setup if I make the maildir group-readable and group-writable.

What do you get from

```

ls -l  /home/vmail/public/dummyacc/

```

Try chmod 770 in this dir (assuming you are in its group, if you see what I mean).

Sorry if this is a waste of time.

----------

## expat_iain

Never a waste of time if it garners more information. Permissions are 770 through that dir.

Regs.

Iain.

----------

## expat_iain

Anyone recommend a decent howto on implementing Cyrus with shared folders?? :0)

----------

## langthang

 *expat_iain wrote:*   

> Anyone recommend a decent howto on implementing Cyrus with shared folders?? :0)

 

I don't know one. Here is my short version.

```
$ cyradm --user <admin_user> <imap_server>

imap_server> sam help

imap_server> lm

imap_server> sam user.user_has_share@mydomain.com user_allow_to_read@mydomain.com lir

imap_server> lam user.user_has_share@mydomain.com

user_allow_to_read@mydomain.com lri

imap_server> exit
```

man cyradm for more details.

----------

## expat_iain

According to the Courier people, this seems to be a problem with Evolution. There's another thread that goes into the details of what was happening here.

Regs.

Iain.

----------

