Addition/Shared folders with dovecot 1.2

From iRedMail
(Difference between revisions)
Jump to: navigation, search

Revision as of 06:56, 31 March 2011


Note by iRedMail team: It's recommended to try this tutorial for iRedMail-0.7.0 and later versions.


Enable shared folders under iRedMail with dovecot 1.2.


  • A properly working iRedMail system;
  • A properly working dovecot 1.2 instead of the default 1.1;


  • This article was written with a CentOS-based system in mind. Adapt it for your system.
  • You must have a good knowledge of the internal workings of iRedMail, mail services and so on.
  • Do not mistake "shared folders" for "public folders". For shared folders, users must select which folder they want to share and with who, using an interface, like the ones available with SOGo and SOGo connectors.

Step-by-step configuration

  • Step 1.

Add proper namespaces to dovecot.conf:

# Namespaces
namespace private {
	subscriptions = yes
	separator = /
	prefix = 
	inbox = yes

namespace shared {
	subscriptions = no
	separator = /
	prefix = Shared/%%u/
	location = maildir:%%Lh/Maildir:INDEX=%Lh/Maildir/Shared/%%Lu
	list = children
	hidden = no
	inbox = no

The private namespace is the default namespace, if it's already in the config do not add it a second time. shared is the one we need here.

  • Step 2.

Add proper ACL dictionary to dict section of dovecot.conf:

dict {
    acl = mysql:/etc/dovecot-acl-shared-dict.conf
  • Step 3.

Add ACLs to protocol imap in dovecot.conf:

protocol imap {
    mail_plugins = quota imap_quota expire [...] acl imap_acl
  • Step 4.

Add plugin section for ACLs in dovecot.conf:

plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  • Step 5.

Create the file /etc/dovecot-acl-shared-dict.conf:

connect = host=localhost dbname=vmail user=vmailadmin password=PASSWORD_HERE

map {
  pattern = shared/shared-boxes/user/$to/$from
  table = user_shares
  value_field = dummy

  fields {
    from_user = $from
    to_user = $to
  • Step 6.

Create table user_shares in vmail database:

CREATE TABLE `user_shares` (
  `from_user` varchar(100) NOT NULL,
  `to_user` varchar(100) NOT NULL,
  `dummy` char(1) default NULL,
  PRIMARY KEY  (`from_user`,`to_user`)
  • Step 7 - Optional - This is not needed if you use a version of iRedMail higher or equal to iRedMail-0.6.0, which already includes this fix.

If you haven't done it already when upgrading to dovecot 1.2, then add a new column, `enableinternal` to `mailbox` table, type bool, default true:

`enableinternal` tinyint(1) NOT NULL default '1'

--Maxie ro 11:11, 2 June 2010 (UTC)

Personal tools