[Dovecot] Shared folders, please help.!

Johan Hendriks joh.hendriks at gmail.com
Mon Oct 11 18:11:56 EEST 2010


  Hello all,
First of all sorry for this, it has been discussed many times, but i can 
not make it work.

I tried for a long time now.
I do something wrong, but i do not know what.

First of all, i have virtual users, with virtual domains.
Mail is stored in /usr/local/virtual/domain name/user

So if my domain is domain.com and my e-mail address is johan at domain.com 
the directory is
/usr/local/virtual/domain.com/johan

i followed the wiki, and my configuration looks like the following.

beasty dovecot # dovecot -n

# 2.0.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.1-STABLE amd64  ufs
auth_debug = yes
auth_debug_passwords = yes
auth_mechanisms = plain login
auth_verbose = yes
dict {
   acl = mysql:/usr/local/etc/dovecot/dovecot-dict-acl-sql.conf
   quotadict = mysql:/usr/local/etc/dovecot/dovecot-dict-quota.conf
}
disable_plaintext_auth = no
first_valid_gid = 1004
first_valid_uid = 1004
last_valid_gid = 1004
last_valid_uid = 1004
log_timestamp = .%Y-%m-%d %H:%M:%S .
mail_access_groups = vmail
mail_debug = yes
mail_gid = 1004
mail_location = maildir:/usr/local/virtual/%d/%n
mail_uid = 1004
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date
mbox_write_locks = fcntl
namespace {
   hidden = no
   inbox = yes
   list = yes
   location =
   prefix =
   separator = /
   subscriptions = yes
   type = private
}
namespace {
   inbox = no
   list = children
   location = maildir:/usr/local/virtual/%%d/%%n/shared/:INDEX=/shared/%%n
   prefix = shared/%%d/%%u/
   separator = /
   subscriptions = no
   type = shared
}
passdb {
   args = /usr/local/etc/dovecot/dovecot-mysql.conf
   driver = sql
}
plugin {
   acl = vfile
   acl_anyone = allow
   acl_shared_dict = proxy::acl
   autocreate = Trash
   autocreate2 = Junk
   autocreate3 = Sent
   autocreate4 = Drafts
   autocreate5 = Templates
   autosubscribe = Trash
   autosubscribe2 = Junk
   autosubscribe3 = Sent
   autosubscribe4 = Drafts
   autosubscribe5 = Templates
   quota = dict:::proxy::quotadict
   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
   quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
}
protocols = imap pop3
service auth {
   unix_listener /var/spool/postfix/private/auth {
     group = postfix
     mode = 0660
     user = postfix
   }
   unix_listener auth-master {
     group = vmail
     mode = 0660
     user = vmail
   }
}
service dict {
   unix_listener dict {
     mode = 0600
     user = vmail
   }
}
service imap-login {
   inet_listener imap {
     address = 192.168.50.200
     port = 143
   }
}
service pop3-login {
   inet_listener pop3 {
     address = 192.168.50.200
     port = 110
   }
}
ssl = no
userdb {
   args = /usr/local/etc/dovecot/dovecot-mysql.conf
   driver = sql
}
protocol imap {
   imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
   imap_idle_notify_interval = 2 mins
   imap_logout_format = bytes=%i/%o
   imap_max_line_length = 64 k
   mail_plugins = quota imap_quota autocreate acl imap_acl mail_log notify
}
protocol pop3 {
   mail_plugins = quota trash
   pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
   pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
   auth_socket_path = /var/run/dovecot/auth-master
   mail_plugins = quota acl mail_log notify
   postmaster_address = postmaster at test.com
   sendmail_path = /usr/local/sbin/sendmail
}


That is my config file.
My dovecot-dict-acl-sql.conf looks like the following

connect = host=localhost dbname=postfix user=postfix password=password

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

   fields {
     from_user = $from
     to_user = $to
   }
}

That is slightly different than the wiki says, if i use that , it gives 
me an error.
the pattern on the wiki looks like this
pattern = shared/shared-boxes/users/$to/$from

if i login as user johan and set ACL on my INBOX i do it this way.
i telnet to the server and issue the following

beasty dovecot # telnet 192.168.50.200 143
Trying 192.168.50.200...
Connected to beasty.localdomain.local.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE 
AUTH=PLAIN AUTH=LOGIN] imap, pop ready
a login johan at domain.com mypass
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE 
SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT 
IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE 
QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA 
ACL RIGHTS=texk] Logged in
b SETACL INBOX hans at domain.com lr
b OK Setacl complete.
c GETACL INBOX
* ACL "INBOX" "hans at domain.com" lr "johan at domain.com" lrwstipekxacd
c OK Getacl completed.

This looks good i guess, also my database is filled, with the from and to !

But i can not see the mailbox if i login as user hans.

beasty dovecot # telnet 192.168.50.200 143
Trying 192.168.50.200...
Connected to beasty.localdomain.local.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE 
AUTH=PLAIN AUTH=LOGIN] imap, pop ready
a login hans at domain.com hanspass
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE 
SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT 
IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE 
QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA 
ACL RIGHTS=texk] Logged in
b list "" *
* LIST (\HasNoChildren) "/" "Trash"
* LIST (\HasNoChildren) "/" "Junk"
* LIST (\HasNoChildren) "/" "Sent"
* LIST (\HasNoChildren) "/" "Drafts"
* LIST (\HasNoChildren) "/" "Templates"
* LIST (\HasNoChildren) "/" "INBOX"
b OK List completed.
c list "" /shared/*
c OK List completed.

If been trying this for a very long time now, but can not see what i am 
missing.
It must be something i ovelook, but i really can not find out what.

I also tried some other configs from the mailing list, but still the 
same, no go.

Thank you for your time to help another one with this issue. i am a 
little ashamed :D


regards,
Jo


More information about the dovecot mailing list