Dovecot shared mailboxes (the correct way)

I’ve just implemented shared mailboxes in dovecot (which rocks, btw). It isn’t difficult, but I don’t think it’s very well documented

The preferred way to do this is with IMAP Namespaces. My natural approach would be to create something like a Maildir tree /srv/mail/shared, and make this the “public” namespace. Then set filesystem permissions on subtrees of that, to define who can see what. Unfortunately, dovecot uses strict Maildir++, and won’t let you create mailboxes inside each other (on the filesystem) /Foo/Bar is stored as a Maildir called .Foo.Bar, so subtrees don’t exist, so this isn’t an option. The up-comming dbox format should allow something like this, but it isn’t usable yet.

My solution was to create multiple namespaces. One for each shared mailbox. Users are given permission to use them via file-system permissions (i.e. group membership), example:

# Default namespace, needed if you add namespaces
namespace private {
    prefix =
    separator = /
    index = yes
}
# Office inbox, available to receptionists, office managers, and directors:
namespace public {
   prefix = office/
   separator = /
   location = maildir:/srv/mail/office/.Maildir:CONTROL=~/.Maildir/control/office:INDEX=~/.Maildir/index/office
   hidden = no
}
# Umask for shared folders
umask = 0007

Setting CONTROL and INDEX mean that dovecot’s metadata is stored in the user’s personal Maildir, so users who don’t have permission to see the shared mailbox don’t get errors.

The permissions of the mailbox should be done as follows:

# touch /srv/mail/office/dovecot-shared
# chown -R mail.office-mailbox /srv/mail/office
# find /srv/mail/office -type d -print0 | xargs -0 chmod 2770
# find /srv/mail/office -type f -print0 | xargs -0 chmod 660

If you want a common subscription list, you have to manually symlink:

# ln -s /srv/mail/office/subscriptions ~luser/.Maildir/control/office/

Seems to work well. (at least with thunderbird)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thank you! I made shared mailb

Thank you! I made shared mailbox :-D

Can you help me? Sorry for my

Can you help me? Sorry for my english, i'm russian ;-)
I have this situation:

I want migrate server to debian + dovecot

  • users info@... and test@... made
  • user test@... can use shared mailbox account info@...

But! How to make the user test@... to send a letter on behalf of the user info@...?

Thank you!

denvist: That's up to your e-m

denvist: That's up to your e-mail client. You can tell it you are sending from any address you want.

Mozilla Thunderbird supports multiple identities quite nicely, if that's what you are looking for.

can you tell me: what is bette

can you tell me: what is better for imap mbox or maildir?

About shared mailbox: "Public

About shared mailbox:

"Public Folders Concepts and Applications with MDaemon 6.0.
Group Inboxes
Customer service organizations often use group inboxes to receive email requests. Everyone in the customer service group has read and write access to the collective incoming mailbox. In this manner, anyone in the group can respond to each incoming email."

Can i made this in dovecot?

denvist: Yes. maildir is prob

denvist: Yes.

maildir is probably better, unless you are likely to run short of inodes.

sorry, but maybe you can help

sorry, but maybe you can help me?
i can made shared mailbox, everything work perfect! But how create group inbox? I can't understand =(

This works

Your (correct way) of configuring shared folders work just fine after about a week of trials with dovecot, thanks to you I managed to make them behave normal, at last!
I wanted something else, dovecot + maildir + vpopmail + mysql and many users.
All of them need to access one shared namespace in which I've linked the maildirs of some _special_ users. For example office@domain.com is a vpopmail user office@domain.com with a normal maildir like all users (/var/vpopmail/domains/domain.com/office). In /var/vpopmail/domains/domain.com/shared (a simple directory) I've linked /var/vpopmail/domains/domain.com/office/.maildir into ./office.
When I create a user in vpopmail, even since first login (Thunderbird or Outlook) this user can see his inbox and at the same level the namespace "shared" with a subdirectory called "office". Everything received by office is shared between users and they can subscribe to this and can see mail received for office.
I've also played with general ACL in dovecot and managed to limit user accesses into the shared folder so that they have no right to modify any e-mail, delete or insert new. Of course some users can do that with the correct rights.

Anyway this is my THANK YOU message. So thank you very much for this post!

problem dovecot

good morning, friends need your help to set a public mailbox in dovecot 1.1, because the truth is there are procedures that do not quite understand

this is the configuration of dovecot.conf:

mail_location = maildir: / var / vmail /% u: INDEX = / var / indexes /% u

######## NameSpace
namespace private {
prefix =
separator = /
inbox = yes
}

{public namespace
prefix = buzonpublico /
separator = /
location = maildir: / var / vmail / buzonpublico: CONTROL = / var / vmail / buzonpublico: INDEX = / var / indexes / buzonpublico
inbox = no
hidden = no
}
################################################## #####

1) by placing the directive CONTROL = / var / vmail / buzonpublico. believe there is a hidden directory called. INBOX
2) enter this directory and generate a symbolic link as follows. in / var / vmail / buzonpublico / .INBOX
ln-s / var / vmail / buzonpublico / *.

it generates me a link to the folders located in / var / vmail / buzonpublico with ell directory. INBOX

cur -> cur
tmp -> tmp
new -> new

In my clients see the option to subscribe to INDEX the public mailbox. and I can see the mail. but when a new mail
I creates problems for the type of permission on the file created by the mail in the folder / cur (640). Change the file permissions to 777 and get to see again the mail, but I again receive another email change the permissions on the new mail file is created in the / cur. What I mean is that by creating the file permissions to be created automatically by the system not allow me to view the customer mail

Also observed in the mail.log I generated this error

file_dotlock_open (/ var / vmail / buzonpublico / .INBOX / dovecot-uidlist. ------------ This is for all the mailboxes that you try to access the public mailbox

I do not understand where is my fault ....

I have the same problem with

I have the same problem with the permissions for the new emails that are getting to Maildir. If I manually change the permissions to g+rw the emails can be seen by user. Is there any method?
Thinking this might solve my issue, I also tried to add in my /etc/dovecot.conf the following lines, but after i entered them dovecot failed to start:
# Umask for shared folders
umask = 0007

PErmissions under OS X Server

Hi, i try to understand the settings working under Apple Os X Server.

# find /srv/mail/office -type d -print0 | xargs -0 chmod 2770
# find /srv/mail/office -type f -print0 | xargs -0 chmod 660

How to read this in the Mac Way ... ?
The mail location folder needs to be read/write for the group of mail users that can acces the shared mailbox .. ?

Yes

Yes, writeable by the users.

To keep the files that way, it helps to have the directories have the setgid bit.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.