Source

iredmail / iRedMail / samples / dovecot / dovecot-share-folder.conf

Full commit
connect = host=PH_SQL_SERVER dbname=PH_DOVECOT_SHARE_FOLDER_DB_NAME user=PH_DOVECOT_SHARE_FOLDER_DB_USER password=PH_DOVECOT_SHARE_FOLDER_DB_PASSWORD
map {
    pattern = shared/shared-boxes/user/$to/$from
    table = PH_DOVECOT_SHARE_FOLDER_DB_TABLE
    value_field = dummy

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

# To share mailbox to anyone, please uncomment 'acl_anyone = allow' in
# dovecot.conf
map {
    pattern = shared/shared-boxes/anyone/$from
    table = PH_DOVECOT_SHARE_FOLDER_ANYONE_DB_TABLE
    value_field = dummy
    fields {
        from_user = $from
    }
}