This allows acl plugin to check ACLs for autocreated mailboxes as well.
}
static int
-imapc_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+imapc_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r)
{
+ if (auto_boxes && mailbox_is_autocreated(box)) {
+ *existence_r = MAILBOX_EXISTENCE_SELECT;
+ return 0;
+ }
+
if (strcmp(box->list->name, MAILBOX_LIST_NAME_IMAPC) != 0) {
if (box->inbox_any)
*existence_r = MAILBOX_EXISTENCE_SELECT;
return 0;
}
-int index_storage_mailbox_exists(struct mailbox *box,
- bool auto_boxes ATTR_UNUSED,
+int index_storage_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r)
{
+ if (auto_boxes && mailbox_is_autocreated(box)) {
+ *existence_r = MAILBOX_EXISTENCE_SELECT;
+ return 0;
+ }
+
return index_storage_mailbox_exists_full(box, NULL, existence_r);
}
}
static int
-maildir_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+maildir_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r)
{
+ if (auto_boxes && mailbox_is_autocreated(box)) {
+ *existence_r = MAILBOX_EXISTENCE_SELECT;
+ return 0;
+ }
+
return index_storage_mailbox_exists_full(box, "cur", existence_r);
}
}
static int
-pop3c_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+pop3c_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r)
{
- if (box->inbox_any)
+ if ((auto_boxes && mailbox_is_autocreated(box)) || box->inbox_any)
*existence_r = MAILBOX_EXISTENCE_SELECT;
else
*existence_r = MAILBOX_EXISTENCE_NONE;
}
static int
-index_list_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+index_list_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r)
{
+ if (auto_boxes && mailbox_is_autocreated(box)) {
+ *existence_r = MAILBOX_EXISTENCE_SELECT;
+ return 0;
+ }
+
struct index_mailbox_list *list =
(struct index_mailbox_list *)box->list;
return 0;
}
- if (auto_boxes && mailbox_is_autocreated(box)) {
- *existence_r = MAILBOX_EXISTENCE_SELECT;
- return 0;
- }
-
if (box->v.exists(box, auto_boxes, existence_r) < 0)
return -1;