Thanks to Timo's advise (much appreciated!), I shifted the mail root to /mail 
dir. Now I have a simplest config where the bug triggers flawlessly. Feel free 
to test on a clean Debian machine; it’s a 100% reproducible.

1. Setting up the environment:

groupadd -g 500 vmail && useradd -M -u 500 -g vmail -s /bin/false vmail && 
mkdir -p /mail && chown vmail:vmail /mail

2. Copy-paste dovecot.conf from the bottom of this mail & start dovecot.
3. Save eml to INBOX of user1 with CLI.

doveadm save -u user1 -m INBOX /tmp/1.eml

4. Both works: saving with APPEND too.

curl -u "user1:hello" -k imap://localhost:143/INBOX --upload-file /tmp/1.eml

5. Share rights with user2.

doveadm acl add -u user1 INBOX user=user2 lookup read write write-seen 
write-deleted insert post expunge create delete admin

6. Try SEARCH ALL & SORT from owner. It works pretty well.

curl -u "user1:hello" -k imap://localhost:143/INBOX -X "UID SEARCH ALL"
SEARCH 1 2
curl -u "user1:hello" -k imap://localhost:143/INBOX -X "UID SORT (REVERSE 
ARRIVAL) US-ASCII NOT DELETED"
SORT 2 1

7. Try same thing over imapc from user2 (over shared namespace).

curl -u "user2:hello" -k imap://localhost:143/shared/user1/INBOX -X "UID SEARCH 
ALL"
SEARCH 1 2
curl -u "user2:hello" -k imap://localhost:143/shared/user1/INBOX -X "UID SORT 
(REVERSE ARRIVAL) US-ASCII NOT DELETED"
SORT

SORT does not return any UIDs, but SEARCH does. Do you see that? Can You help 
with this, please?

------------------------------------------
```
dovecot_config_version = 2.4.4
dovecot_storage_version = 2.4.4

mail_debug = yes

acl_driver = vfile
auth_master_user_separator = *
auth_allow_cleartext = yes
mail_driver = maildir
mail_home = /mail/%{user}
mail_path = ~
mail_inbox_path = ~/.INBOX
mail_index_path = ~
mail_control_path = ~
mail_uid = vmail
mail_gid = vmail
first_valid_uid = 500
mail_shared_explicit_inbox = yes

imapc_host = 127.0.0.1
imapc_master_user = %{user}
imapc_password = any
imapc_port = 143

service auth {
  unix_listener auth-userdb {
    mode = 0660
    user = vmail
    group = vmail
  }
  unix_listener auth-master {
    mode = 0660
    group = vmail
  }
}

acl_sharing_map {
  dict file {
    path = /mail/shared.db
  }
}

protocols {
  imap = yes
}

mail_plugins {
  acl = yes
}

protocol imap {
  mail_plugins {
    imap_acl = yes
  }
}

service imap-login {
  inet_listener imaps {
    port = 0
  }
}

passdb anypass-imapc {
  master = yes
  driver = static
  fields {
    nopassword = yes
    userdb_acl_user = %{auth_user}
  }
}

passdb anypass-users {
  driver = static
  fields {
    nopassword = yes
  }
}

namespace inbox {
  inbox = yes
  separator = /
}

namespace shared {
  type = shared
  separator = /
  prefix = shared/$user/
  acl_ignore = yes
  list = children
  subscriptions = no
  mail_driver = imapc
  mail_path = ~/shared/%{owner_user}
  mail_index_path = ~/shared/%{owner_user}
  mail_control_path = ~/shared/%{owner_user}
}
```
------------------------------------------
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to