Dear all,

I'm configuring Dovecot 2.4.1 with per-user mailbox format support, but
cannot get user shared mailbox working between different mailbox formats.

- Account [email protected] is a mdbox format mailbox, access with webmail is ok.
- Account [email protected] is a maildir format mailbox, access with webmail 
is ok.
- mdbox@ shares its Sent folder to maildir@ with Roundcube webmail,
  grants all privileges (`akxeilprwts`).

The result is maildir@ cannot see the shared folder.

- No error reported in Dovecot log file.
- mysql logs the queries performed to get user shared mailbox, i ran the
  query manually and it returns correct result like this:

```
MariaDB [vmail]> SELECT dummy,from_user FROM share_folder WHERE to_user = 
'[email protected]' \G
*************************** 1. row ***************************
    dummy: 1
from_user: [email protected]
```

dovecot.conf snippet attached below. I think the "mail_*" parameters inside
`namespace shared {}` block are incorrect to handle mixed
mailbox formats because it hard-codes the mail_driver and mail_path, tried all
possible parameters i can imagine, but failed.

Thanks for helping. :)

# ------------------------
mail_plugins {
    acl = yes
    ...
}

protocol imap {
    mail_plugins {
        imap_acl = yes
        ...
    }
    ...
}

mail_driver = %{userdb:mail_driver | default("maildir") | lower}
mail_path = %{userdb:mail_path | default("~/Maildir")}

sql_driver = mysql
mysql 127.0.0.1 {
    port = ...
    dbname = ...
    user = ...
    password = ...
}

userdb sql {
    # ... omit other lines ...
    query = SELECT \
            LOWER('%{user | lower}') AS master_user, \
            LOWER(CONCAT(mailbox.storagebasedirectory, '/', 
mailbox.storagenode, '/', mailbox.maildir)) AS home, \
            mailbox.mailboxformat AS mail_driver, \
            CONCAT("~/", mailbox.mailboxfolder) AS mail_path, \
            CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
        FROM ...
}

namespace shared {
    type = shared
    separator = /
    prefix = Shared/$user/
    subscriptions = yes
    list = children

    mail_driver = maildir
    mail_path = %{owner_home}/Maildir
    mail_index_private_path = ~/Maildir/shared/%{owner_user}
    # not share the index files between users
    mail_index_path = ~/Maildir/shared/%{owner_user}
}

acl_driver = vfile
acl_globals_only = no

acl_sharing_map {
    dict proxy {
        name = acl
    }
}

dict_server {
    dict acl {
        driver = sql

        dict_map shared/shared-boxes/user/$to/$from {
            sql_table = share_folder
            value_field dummy {
            }

            key_field from_user {
                value = $from
            }
            key_field to_user {
                value = $to
            }
        }

        dict_map shared/shared-boxes/anyone/$from {
            sql_table = anyone_shares
            value_field dummy {
            }

            key_field from_user {
                value = $from
            }
        }
    }

    ...
}
# ------------------------
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to