[Dovecot] Shared folders, please help.!

Johan Hendriks joh.hendriks at gmail.com
Thu Oct 14 21:12:29 EEST 2010


2010/10/14 Timo Sirainen <tss at iki.fi>:
> On Thu, 2010-10-14 at 19:40 +0200, Johan Hendriks wrote:
>> e select shared/domain.com/johan/INBOX
>> e NO Character not allowed in mailbox name: '.'
>
> This looks as if it's not even seeing the shared namespace. What does it
> log with mail_debug=yes?
>
>> namespace {
>>    inbox = no
>>    list = children
>>    location = maildir:/usr/local/virtual/%%d/%%n/shared/:INDEX=/shared/%%n
>>    prefix = shared/%%d/%%u/
>
> Also the :INDEX= path is now identical for two users in different
> domains. You should use %%u or %%d/%%n there as well.
>
>
>
Ok i did the following.

edit the dovecot.conf file also the dovecot-dict-acl.sql file.

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] Dovecot ready.
a login johan at domain.com
a BAD Error in IMAP command received by server.
a login johan at domain.com johanpass
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 DELETEACL INBOX hans at domain.com
b OK Deleteacl complete.
c GETACL INBOX
* ACL "INBOX" "johan at domain.com" lrwstipekxacd
c OK Getacl completed.
d SETACL INBOX hans at domain.com lr
d OK Setacl complete.
e GETACL INBOX
* ACL "INBOX" "hans at domain.com" lr "johan at domain.com" lrwstipekxacd
e OK Getacl completed.
^C^]
telnet> quit
Connection closed.

Then i login as hans

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] Dovecot 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 "" /shared/*
b OK List completed.
c list "" shared/domain.com/johan/*
c OK List completed.
d select shared/domain.com/johan/INBOX
d NO Character not allowed in mailbox name: '.'


i got the following log in /var/log/maillog

Oct 14 19:56:56 beasty dovecot: dict: mysql: Connected to localhost (postfix)
Oct 14 19:58:03 beasty dovecot: imap(johan at domain.com): Connection
closed bytes=112/536
Oct 14 19:58:29 beasty dovecot: auth: mysql: Connected to localhost (postfix)
Oct 14 19:58:29 beasty dovecot: imap-login: Login:
user=<hans at domain.com>, method=PLAIN, rip=192.168.50.200,
lip=192.168.50.200, mpid=6615, secured
Oct 14 19:59:53 beasty dovecot: dict: Error: sql dict iterate:
Invalid/unmapped path: shared/shared-boxes/anyone/
Oct 14 19:59:53 beasty dovecot: dict: mysql: Connected to localhost (postfix)


dovecot -n is now
- Tekst uit oorspronkelijke bericht weergeven -

# 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/%%d/%%n
 prefix = shared/%%d/%%u/
- Tekst uit oorspronkelijke bericht weergeven -
 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
}

My dovecot-dict-acl-sql.conf file looks like the following

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

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

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

In my table from mysql i see the following
mysql> select * from  user_shares;
+-----------------------+----------------------+-------+
| from_user             | to_user              | dummy |
+-----------------------+----------------------+-------+
| johan at domain.com | hans at domain.com | 1     |
+-----------------------+----------------------+-------+
1 row in set (0.00 sec)

regards,
Johan Hendriks


More information about the dovecot mailing list