1

Topic: Shared Folders

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

Hello,

Something strange is happening http://www.iredmail.org/wiki/index.php? … .8.0-0.8.1 tried to follow the tutorial.
My sharing is working, but can not display only the shared folder when I leave the option subscriptions = yes in dovecot.conf. subscriptions = yes appears fastas ALL of the User who shared IMAP.

What I do is stop subscriptions = no and when a folder is shared I add manually in thunderbird which ends up being a bit boring.

The following error when I try to follow the tutorial, I thought to follow the tutorial to fix the error display all shared folders when.

Jul 17 15:55:55 dict: Error: sql dict set: Invalid/unmapped key: shared/shared-boxes/user/feoliveira@simtrack.com.br/fmoreni@simtrack.com.br
Jul 17 15:55:55 imap(fmoreni@simtrack.com.br): Error: acl: dict commit failed


map {
    pattern = shared/shared-boxes/anyone/$from
    table = anyone_shares
    value_field = dummy
    fields {
        from_user = $from
    }
}

Dovecot.conf
acl_anyone = allow

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Shared Folders

Please show us output of command "dovecot -n" and ACL config file /etc/dovecot/dovecot-share-folder.conf.

Also, please, it's always a good idea to tell us basic info of your iRedMail server, so that we don't need to reply to ask you show basic info, and you get faster answer too.

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

3

Re: Shared Folders

Sorry


# 2.0.18: /etc/dovecot/dovecot.conf
doveconf: Warning: service auth { client_limit=10000 } is lower than required under max. load (12348)
doveconf: Warning: service anvil { client_limit=10000 } is lower than required under max. load (10203)
# OS: Linux 2.6.32-279.1.1.el6.x86_64 x86_64 CentOS release 6.2 (Final)
auth_mechanisms = PLAIN LOGIN
auth_verbose = yes
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  expire = db:/var/lib/dovecot/expire/expire.db
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
last_valid_uid = 500
listen = *
log_path = /var/log/dovecot.log
mail_gid = 500
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_plugins = " lazy_expunge"
mail_uid = 500
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 ihave
namespace {
  inbox = yes
  location =
  prefix =
  separator = /
  type = private
}
namespace {
  hidden = yes
  list = no
  location = maildir:/%Lh/Maildir/expunged:INDEX=/%Lh/Maildir/expunged
  prefix = .EXPUNGED/
  separator = /
}
namespace {
  list = children
  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = no
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  auth_socket_path = /var/run/dovecot/auth-master
  autocreate = INBOX
  autocreate2 = Sent
  autocreate3 = Trash
  autocreate4 = Drafts
  autocreate5 = Junk
  autocreate6 = Spam
  autosubscribe = INBOX
  autosubscribe2 = Sent
  autosubscribe3 = Trash
  autosubscribe4 = Drafts
  autosubscribe5 = Junk
  autosubscribe6 = Spam
  expire = Trash 7 Trash/* 7 Junk 30 Spam 7 Spam/* 7 Spam 30
  expire_dict = proxy::expire
  hidden = yes
  lazy_expunge = .EXPUNGED/
  list = no
  quota = dict:user::proxy::quotadict
  quota_rule = *:storage=5G
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = /%Lh/sieve/dovecot.sieve
  sieve_dir = /%Lh/sieve
  sieve_global_dir = /opt/vmail/sieve
  sieve_global_path = /opt/vmail/sieve/dovecot.sieve
}
protocols = pop3 imap sieve
service anvil {
  client_limit = 10000
}
service auth {
  client_limit = 10000
  unix_listener /var/spool/postfix/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  client_limit = 10000
  process_limit = 10000
}
service imap {
  client_limit = 10000
}
service managesieve-login {
  inet_listener sieve {
    port = 2000
  }
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/pki/tls/certs/simtrack.com.br.pem
ssl_key = </etc/pki/tls/private/simtrack.com.br.key
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  log_path = /var/log/sieve.log
  mail_plugins = quota sieve autocreate acl lazy_expunge
  postmaster_address = root
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_plugins = quota imap_quota autocreate acl imap_acl lazy_expunge
}
protocol pop3 {
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}



connect = host=127.0.0.1 dbname=iredadmin user=iredadmin password=5lpwVEG6ml31Huu7SNHvC41WVsAbvz
map {
    pattern = shared/shared-boxes/user/$to/$from
    table = share_folder
    value_field = dummy

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

4

Re: Shared Folders

I cannot figure out what the root cause is. Sorry. sad

Please turn on debug mode in Dovecot and find ACL related log for troubleshooting.

Don't forget to fix these two warnings:

doveconf: Warning: service auth { client_limit=10000 } is lower than required under max. load (12348)
doveconf: Warning: service anvil { client_limit=10000 } is lower than required under max. load (10203)

5

Re: Shared Folders

i have this error in my dovecot log. what it's mean?


Dec 15 04:19:12 imap(test@example.com): Info: Disconnected: Logged out in=58 out=740
Dec 15 04:19:12 imap-login: Info: Login: user=<test@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3590, secured, session=<aJZuwapD0wB/AAAB>
Dec 15 04:19:12 dict: Error: Failed to initialize dictionary 'acl': dict mysql: Can't open configuration file /etc/dovecot/dovecot-share-folder.conf: Permission denied
Dec 15 04:19:12 dict: Error: Failed to initialize dictionary 'acl': dict mysql: Can't open configuration file /etc/dovecot/dovecot-share-folder.conf: Permission denied
Dec 15 04:19:12 imap(test@example.com): Error: write(/var/run/dovecot/dict) failed: Broken pipe
Dec 15 04:19:12 dict: Error: Failed to initialize dictionary 'acl': dict mysql: Can't open configuration file /etc/dovecot/dovecot-share-folder.conf: Permission denied
Dec 15 04:19:12 imap(test@example.com): Error: write(/var/run/dovecot/dict) failed: Broken pipe
Dec 15 04:19:12 imap(test@example.com): Info: Disconnected: Logged out in=233 out=907



thanks

6

Re: Shared Folders

lansulquiorra wrote:

Dec 15 04:19:12 dict: Error: Failed to initialize dictionary 'acl': dict mysql: Can't open configuration file /etc/dovecot/dovecot-share-folder.conf: Permission denied

It's very clear in this log line.

7

Re: Shared Folders

ZhangHuangbin wrote:
lansulquiorra wrote:

Dec 15 04:19:12 dict: Error: Failed to initialize dictionary 'acl': dict mysql: Can't open configuration file /etc/dovecot/dovecot-share-folder.conf: Permission denied

It's very clear in this log line.

should be owned by vmail or dovecot? and what permission for this file?

thanks

8

Re: Shared Folders

Should be owned by dovecot user/group, with permission 0500.

9

Re: Shared Folders

ZhangHuangbin wrote:

Should be owned by dovecot user/group, with permission 0500.

still same error even i changed permission and owner for those file. i can't send or receive email too, but i can login to roundcube and iredmail. here my dovecot conf:


first_valid_uid = 2000
last_valid_uid = 2000
listen = * [::]
log_path = /var/log/dovecot.log
mail_gid = 2000
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/
mail_plugins = quota mailbox_alias acl
mail_uid = 2000
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 ihave
namespace {
  inbox = yes
  location =
  mailbox Archive {
    auto = no
    special_use = \Archive
  }
  mailbox Archives {
    auto = no
    special_use = \Archive
  }
  mailbox "Deleted Messages" {
    auto = no
    special_use = \Trash
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox "Junk E-mail" {
    auto = no
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Items" {
    auto = no
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    special_use = \Sent
  }
  mailbox Spam {
    auto = no
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-master-users
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  auth_socket_path = /var/run/dovecot/auth-master
  mailbox_alias_new = Sent Messages
  mailbox_alias_new2 = Sent Items
  mailbox_alias_old = Sent
  mailbox_alias_old2 = Sent
  quota = dict:user::proxy::quotadict
  quota_grace = 10%%
  quota_rule = *:storage=1G
  quota_warning = storage=100%% quota-warning 100 %u
  quota_warning2 = storage=95%% quota-warning 95 %u
  quota_warning3 = storage=90%% quota-warning 90 %u
  quota_warning4 = storage=85%% quota-warning 85 %u
  sieve = %Lh/sieve/dovecot.sieve
  sieve_before = /var/vmail/sieve/dovecot.sieve
  sieve_dir = %Lh/sieve
  sieve_global_dir = /var/vmail/sieve
}
protocols = pop3 imap sieve lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service lmtp {
  executable = lmtp -L
  inet_listener lmtp {
    address = 127.0.0.1
    port = 24
  }
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    address = 127.0.0.1
    port = 4190
  }
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/ssl/certs/iRedMail.crt
ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
ssl_dh_parameters_length = 2048
ssl_key = </etc/ssl/private/iRedMail.key
ssl_prefer_server_ciphers = yes
ssl_protocols = !SSLv2 !SSLv3
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  lda_mailbox_autosubscribe = yes
  log_path = /var/log/dovecot-sieve.log
  mail_plugins = quota mailbox_alias acl sieve
  postmaster_address = root
}
protocol lmtp {
  info_log_path = /var/log/dovecot-lmtp.log
  lmtp_save_to_detail_mailbox = yes
  mail_plugins = quota sieve
  postmaster_address = postmaster
  recipient_delimiter = +
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl imap_quota imap_acl
}
protocol pop3 {
  mail_max_userip_connections = 30
  mail_plugins = quota mailbox_alias acl
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}





and here my permission :

drwxr-x---   4 vmail   postfix  4096 Dec 13 10:06 .
drwxr-xr-x 114 root    root    12288 Dec 14 03:52 ..
drwxr-xr-x   2 root    root     4096 Dec 13 09:07 conf.d
-rw-rw-r--   1 root    root    12141 Dec 15 03:48 dovecot.conf
-rw-r--r--   1 root    root     4401 Dec 13 08:55 dovecot.conf.2016.12.13.08.48.18
-rw-r--r--   1 root    root    12141 Dec 13 09:13 dovecot.conf.2016.12.13.09.07.26
-rw-r--r--   1 root    root    12141 Dec 13 09:25 dovecot.conf.2016.12.13.09.18.07
-rw-r--r--   1 root    root    12141 Dec 13 10:06 dovecot.conf.2016.12.13.10.05.27
-rw-r--r--   1 root    root     4484 Dec  9 12:14 dovecot.conf.save
-rw-r-----   1 root    dovecot  1507 Jun 20  2015 dovecot-dict-auth.conf.ext
-rw-r-----   1 root    dovecot   852 Jun 20  2015 dovecot-dict-sql.conf.ext
-r-x------   1 root    root     1027 Dec 13 09:13 dovecot-ldap.conf
-rw-------   1 root    root     5292 Jun 20  2015 dovecot-ldap.conf.ext
-r-x------   1 dovecot dovecot     0 Dec 13 10:06 dovecot-master-users
-r-xr-x---   1 root    root      778 Dec 13 10:06 dovecot-mysql.conf
-r-xr-x---   1 root    root      778 Dec 13 09:25 dovecot-mysql.conf.2016.12.13.09.18.07
-r-xr-x---   1 root    root      778 Dec 13 10:06 dovecot-mysql.conf.2016.12.13.10.05.27
-r-x------   1 dovecot dovecot   505 Dec 13 10:06 dovecot-share-folder.conf
-r-x------   1 root    root      505 Dec 13 09:13 dovecot-share-folder.conf.2016.12.13.09.07.26
-r-x------   1 root    root      508 Dec 13 09:25 dovecot-share-folder.conf.2016.12.13.09.18.07
-r-x------   1 root    root      505 Dec 13 10:06 dovecot-share-folder.conf.2016.12.13.10.05.27
-rw-r-----   1 root    dovecot  5612 Jun 20  2015 dovecot-sql.conf.ext
-r-x------   1 dovecot dovecot   334 Dec 13 10:06 dovecot-used-quota.conf
drwx------   2 root    root     4096 Jun 20  2015 private
-rw-r--r--   1 root    root      121 Jun 20  2015 README

10

Re: Shared Folders

Weird, I have same owner and permission on CentOS 6, works for me.

Do you have SELinux enabled? Check /etc/selinux/config.