iRedmail - shared folder

 

"shared folders" 及 "public folders" 是兩件完全不同的事來

 

  • shared folders <-- 用戶自行設定
  • public folders <-- Admin 設定

 

disabled in iRedMail by default

在不同的 Linux distbution 設定有所不同, 在 Debian 上只要  enable acl plugins 就可以

 


 

建立 Shared Folder

 

# telnet localhost 143                   # <- Type this.
* OK [...] Dovecot ready.

. login [email protected] passwd           # <- Type this. Login with my email address and plain password.
. OK [... ACL ..] Logged in

. SETACL Sent [email protected] rli     
# <- Type this. Share folder 'Sent' to user [email protected]
# with permissions: read (r), lookup (l) and insert (i).

. OK Setacl complete.
^]                                       # <- Press 'Ctrl + ]' to exit telnet.
telnet> quit

 

以上指令相當於在 DB: vmai 內 table: share_folder 建立一隻 record

from_user            | to_user                  | dummy
[email protected]      | mail.debian.local        | 1

 

建立了dovecot-acl

內容:

[email protected] ilr

 


 

設定的真面目

 

dovecot version: 1.2   <-- 不同的 version 會有不同的設定 !!

 

Shared Folder 的設定分別在 dovecot.conf 及 dovecot-share-folder.conf 上完成

 

dovecot.conf

Part 1: 啟用 ACL plugin

protocol lda {
    mail_plugins = ... acl
}

protocol imap {
    mail_plugins = ... acl imap_acl
}

 

Part 2: 設備 plugin backend

plugin {
    acl = vfile   <-- ACL backend
    acl_shared_dict = proxy::acl   <-- 設定一張 Shared list, 讓別人知在此 Share Folder, 與 permission 無關 !!
}

dict {
    acl = mysql:/etc/dovecot/dovecot-share-folder.conf
}

 

Remark:

Every time you create a new mailbox, it gets its ACLs from the parent mailbox.

注意是 gets, 而不是 inheritance

 

Part 3:

namespace private {
    separator = /
    prefix =
    inbox = yes
    # location defaults to mail_location.
}

namespace shared {
    separator = /
    prefix = Shared/%%u/
    location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
    # this namespace should handle its own subscriptions or not.
    subscriptions = yes
    list = children
}

 

dovecot-share-folder.conf:

connect = host=127.0.0.1 dbname=vmail user=vmailadmin password=???????
map {
    pattern = shared/shared-boxes/user/$to/$from
    table = share_folder
    value_field = dummy

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

 


 

dovecot version: 2

 

namespace {
  inbox = yes
  subscriptions = yes
  prefix =
  separator = /
  type = private
}

namespace {
  list = yes
  subscriptions = yes
  location = maildir:/%%h/Maildir:INDEX=/%h/Maildir/shared/%%u
  prefix = shared/%%u/
  separator = /
  type = shared
  hidden = no
}

 

 Mysql 加以下 record

 enablelib-storage

 


 

詳見

http://www.iredmail.org/forum/forum2-iredmail-support.html