I need help. I’m trying to reproduce an issue, but I keep hitting so many
errors that I’m completely stuck. I'm reproducing this on a single machine.
1. Setting up the environment:
groupadd -g 500 vmail && useradd -M -u 500 -g vmail -s /bin/false vmail &&
mkdir -p /tmp/mail && chown vmail:vmail /tmp/mail
2. Starting up Dovecot.
3. User mailboxes don’t exist yet.
4. Saving an email via CLI:
doveadm save -u user1 -m INBOX /tmp/1.eml
5. Checking the email UID, but it’s missing:
curl -u "user1:hello" -k imap://localhost:143/INBOX -X "UID SEARCH ALL"
+ SEARCH
6. Saving the exact same email via APPEND:
curl -u "user1:hello" -k imap://localhost:143/INBOX --upload-file /tmp/1.eml
7. Now the UID shows up. But which one? What’s the difference here?
curl -u "user1:hello" -k imap://localhost:143/INBOX -X "UID SEARCH ALL"
+ SEARCH 1
8. Restarting Dovecot.
9. Checking the UID again. And it's gone! Where did it go? It's right there in
the indexes.
curl -u "user1:hello" -k imap://localhost:143/INBOX -X "UID SEARCH ALL"
+ SEARCH
10. The email files are right there in new/. The entries are in
dovecot-uidlist. They're also in dovecot.index.cache.
11. I 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
12. The entry in /tmp/mail/shared.db showed up. However, user2 still can't see
that user1's INBOX has been shared with them. No shared namespace.
curl -u "user2:hello" -k imap://localhost:143/
+ LIST (\HasNoChildren) "/" INBOX
13. When I try to connect the same way imapc does, I get an error saying the
mailbox doesn't exist.
curl -u "user1*user2:hello" -k imap://localhost:143/INBOX -X "UID SEARCH ALL"
A003 NO [NONEXISTENT] Mailbox doesn't exist: INBOX (0.002 + 0.000 + 0.001 secs)
14. But this is not true.
$ tree -a /tmp/mail/
/tmp/mail/
├── shared.db
└── user1
├── dovecot-acl-list
├── dovecot.list.index.log
├── dovecot-uidvalidity
├── dovecot-uidvalidity.6a4029ad
└── .INBOX
├── cur
├── dovecot-acl
├── dovecot.index.cache
├── dovecot.index.log
├── dovecot-uidlist
├── maildirfolder
├── new
│ └── 1782589869.M440304P1305393.mail.test.server,S=3517,W=3584
└── tmp
15. From debug log. I did not set this options. Like it is something inside
logic.
Debug: Ignored unknown userdb field: master_user=user2
16. Here’s what my config looks like.
-------------------------------------
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 = /tmp/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 = /tmp/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]