mailbox-list-private.h revision d6499957ea59e6d9729d3350d9ac5eae992635f6
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define MAILBOX_LIST_NAME_MAILDIRPLUSPLUS "maildir++"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
0a7b04ec6441fdcf083392888b2e30844fc3e86dTimo Sirainen#define T_MAILBOX_LIST_ERR_NOT_FOUND(list, name) \
0a7b04ec6441fdcf083392888b2e30844fc3e86dTimo Sirainen t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen (((flags) & (MAILBOX_SELECT | MAILBOX_NOSELECT | \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*init)(struct mailbox_list *list, const char **error_r);
fc40a9a002458e372ff4b9f6f4e15239520c0bcdTimo Sirainen int (*get_storage)(struct mailbox_list **list, const char *vname,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen char (*get_hierarchy_sep)(struct mailbox_list *list);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *(*get_vname)(struct mailbox_list *list,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *(*get_storage_name)(struct mailbox_list *list,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *vname);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*get_path)(struct mailbox_list *list, const char *name,
d665e2948cb6fe8016706752a9e4940d64f4a61dTimo Sirainen enum mailbox_list_path_type type, const char **path_r);
4ca83616715c3bd417e34ced2c1d61852513e427Timo Sirainen const char *(*get_temp_prefix)(struct mailbox_list *list, bool global);
0fcfa7698e7beb78019ac89a869eef1b41e56a62Timo Sirainen const char *(*join_refpattern)(struct mailbox_list *list,
0fcfa7698e7beb78019ac89a869eef1b41e56a62Timo Sirainen const char *const *patterns,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen (*iter_next)(struct mailbox_list_iterate_context *ctx);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen int (*iter_deinit)(struct mailbox_list_iterate_context *ctx);
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*get_mailbox_flags)(struct mailbox_list *list,
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen /* Returns TRUE if name is mailbox's internal file/directory.
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen If it does, mailbox deletion assumes it can safely delete it. */
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen bool (*is_internal_name)(struct mailbox_list *list, const char *name);
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen /* Read subscriptions from src_list, but place them into
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen dest_list->subscriptions. Set errors to dest_list. */
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*subscriptions_refresh)(struct mailbox_list *src_list,
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*set_subscribed)(struct mailbox_list *list,
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*delete_mailbox)(struct mailbox_list *list, const char *name);
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*delete_dir)(struct mailbox_list *list, const char *name);
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*delete_symlink)(struct mailbox_list *list, const char *name);
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen int (*rename_mailbox)(struct mailbox_list *oldlist, const char *oldname,
03de962febfc2ac572f9e4029463c16d29c1ed55Timo Sirainen struct mailbox_list *newlist, const char *newname);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen int (*notify_next)(struct mailbox_list_notify *notify,
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen const struct mailbox_list_notify_rec **rec_r);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen void (*notify_deinit)(struct mailbox_list_notify *notify);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen void (*notify_wait)(struct mailbox_list_notify *notify,
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen void (*callback)(void *context), void *context);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen unsigned int id;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* private: */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* may not be set yet, use mailbox_list_get_permissions() to access */
0fcfa7698e7beb78019ac89a869eef1b41e56a62Timo Sirainen time_t subscriptions_mtime, subscriptions_read_time;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen HASH_TABLE(uint8_t *, struct mailbox_guid_cache_rec *) guid_cache;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen ARRAY(union mailbox_list_module_context *) module_contexts;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen ARRAY(union mailbox_list_iterate_module_context *) module_contexts;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen struct mailbox_list_iterate_context *iter_ctx;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen enum mailbox_info_flags leaf_flags, parent_flags;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Modules should use do "my_id = mailbox_list_module_id++" and
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen use objects' module_contexts[id] for their own purposes. */
f46885a5b78b15a8d2419f6e5d13b643bd85e41fTimo Sirainenextern struct mailbox_list_module_register mailbox_list_module_register;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenint mailbox_list_settings_parse(struct mail_user *user, const char *data,
const char **error_r);
const char *vname);
const char *storage_name);
const char **path_r);
const char *name);
const char *name);
const char *dir_path,
const struct dirent *d);
const char **name);