Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8426:5c4af90c9155 HEAD
IMAP ACLs: Let MYRIGHTS show the rights even if we don't have "r" permission.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 16 Nov 2008 14:43:14 +0200 |
parents | 65d005f2c28b |
children | 47198d7a5f03 |
files | src/plugins/imap-acl/imap-acl-plugin.c |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/imap-acl/imap-acl-plugin.c Sun Nov 16 14:40:56 2008 +0200 +++ b/src/plugins/imap-acl/imap-acl-plugin.c Sun Nov 16 14:43:14 2008 +0200 @@ -74,10 +74,10 @@ /* not an administrator. */ if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_LOOKUP) <= 0) { client_send_tagline(cmd, t_strdup_printf( - "["IMAP_RESP_CODE_NONEXISTENT"] " + "NO ["IMAP_RESP_CODE_NONEXISTENT"] " MAIL_ERRSTR_MAILBOX_NOT_FOUND, name)); } else { - client_send_tagline(cmd, ERROR_NOT_ADMIN); + client_send_tagline(cmd, "NO "ERROR_NOT_ADMIN); } mailbox_close(&box); return NULL; @@ -231,7 +231,8 @@ if (storage == NULL) return TRUE; - box = mailbox_open(storage, real_mailbox, NULL, ACL_MAILBOX_OPEN_FLAGS); + box = mailbox_open(storage, real_mailbox, NULL, ACL_MAILBOX_OPEN_FLAGS | + MAIL_STORAGE_FLAG_IGNORE_ACLS); if (box == NULL) { client_send_storage_error(cmd, storage); return TRUE; @@ -243,6 +244,13 @@ mailbox_close(&box); return TRUE; } + if (*rights == NULL) { + client_send_tagline(cmd, t_strdup_printf( + "NO ["IMAP_RESP_CODE_NONEXISTENT"] " + MAIL_ERRSTR_MAILBOX_NOT_FOUND, real_mailbox)); + mailbox_close(&box); + return TRUE; + } str = t_str_new(128); str_append(str, "* MYRIGHTS ");