mailbox-list-private.h revision 458752f9e9012482843b92379bcfebecfe26f360
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch#ifndef MAILBOX_LIST_PRIVATE_H
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_LIST_PRIVATE_H
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#include "mail-namespace.h"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#include "mailbox-list.h"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#include "mail-storage-settings.h"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_LIST_NAME_MAILDIRPLUSPLUS "maildir++"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_LIST_NAME_IMAPDIR "imapdir"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_LIST_NAME_FS "fs"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
551fef69c0633ae3c7738038e047a7c0762d9599Timo Sirainen#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenenum mailbox_log_record_type;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct stat;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct dirent;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct imap_match_glob;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_tree_context;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_INFO_FLAGS_FINISHED(flags) \
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen (((flags) & (MAILBOX_SELECT | MAILBOX_NOSELECT | \
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen MAILBOX_NONEXISTENT)) != 0)
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenenum mailbox_dir_create_type {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Creating a mailbox */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen MAILBOX_DIR_CREATE_TYPE_MAILBOX,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Create a \Noselect or a mailbox */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen MAILBOX_DIR_CREATE_TYPE_TRY_NOSELECT,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Create a \Noselect or fail */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen MAILBOX_DIR_CREATE_TYPE_ONLY_NOSELECT
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_list_vfuncs {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list *(*alloc)(void);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen void (*deinit)(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*get_storage)(struct mailbox_list **list, const char *vname,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mail_storage **storage_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool (*is_valid_pattern)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *pattern);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool (*is_valid_existing_name)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool (*is_valid_create_name)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen char (*get_hierarchy_sep)(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*get_vname)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *storage_name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*get_storage_name)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *vname);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*get_path)(struct mailbox_list *list, const char *name,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_path_type type);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*get_temp_prefix)(struct mailbox_list *list, bool global);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*join_refpattern)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *ref, const char *pattern);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_iterate_context *
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen (*iter_init)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *const *patterns,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_iter_flags flags);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const struct mailbox_info *
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen (*iter_next)(struct mailbox_list_iterate_context *ctx);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*iter_deinit)(struct mailbox_list_iterate_context *ctx);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*get_mailbox_flags)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *dir, const char *fname,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_file_type type,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_info_flags *flags_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Returns TRUE if name is mailbox's internal file/directory.
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen If it does, mailbox deletion assumes it can safely delete it. */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool (*is_internal_name)(struct mailbox_list *list, const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Read subscriptions from src_list, but place them into
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen dest_list->subscriptions. Set errors to dest_list. */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*subscriptions_refresh)(struct mailbox_list *src_list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list *dest_list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*set_subscribed)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name, bool set);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*create_mailbox_dir)(struct mailbox_list *list, const char *name,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_dir_create_type type);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*delete_mailbox)(struct mailbox_list *list, const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*delete_dir)(struct mailbox_list *list, const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*delete_symlink)(struct mailbox_list *list, const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*rename_mailbox)(struct mailbox_list *oldlist, const char *oldname,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list *newlist, const char *newname,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool rename_children);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_list_module_register {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen unsigned int id;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenunion mailbox_list_module_context {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_vfuncs super;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_module_register *reg;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_list {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_properties props;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen size_t mailbox_name_max_length;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_vfuncs v, *vlast;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen/* private: */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen pool_t pool;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mail_namespace *ns;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_settings set;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const struct mail_storage_settings *mail_set;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_flags flags;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* -1 if not set yet. use mailbox_list_get_permissions() to set them */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen mode_t file_create_mode, dir_create_mode;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen gid_t file_create_gid;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* origin (e.g. path) where the file_create_gid was got from */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *file_create_gid_origin;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_tree_context *subscriptions;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen time_t subscriptions_mtime, subscriptions_read_time;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_log *changelog;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen time_t changelog_timestamp;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen pool_t guid_cache_pool;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct hash_table *guid_cache;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool guid_cache_errors;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen char *error_string;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mail_error error;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool temporary_error;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen ARRAY_DEFINE(module_contexts, union mailbox_list_module_context *);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen unsigned int index_root_dir_created:1;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenunion mailbox_list_iterate_module_context {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_module_register *reg;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_list_iterate_context {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list *list;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen pool_t pool;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_iter_flags flags;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen bool failed;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct imap_match_glob *glob;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_info specialuse_info;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen ARRAY_DEFINE(module_contexts,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen union mailbox_list_iterate_module_context *);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct mailbox_list_iter_update_context {
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_iterate_context *iter_ctx;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_tree_context *tree_ctx;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct imap_match_glob *glob;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_info_flags leaf_flags, parent_flags;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen unsigned int update_only:1;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen unsigned int match_parents:1;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen};
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen/* Modules should use do "my_id = mailbox_list_module_id++" and
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen use objects' module_contexts[id] for their own purposes. */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenextern struct mailbox_list_module_register mailbox_list_module_register;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_lists_init(void);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_lists_deinit(void);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenint mailbox_list_settings_parse(struct mail_user *user, const char *data,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_settings *set_r,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char **error_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenconst char *mailbox_list_default_get_storage_name(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *vname);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenconst char *mailbox_list_default_get_vname(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *storage_name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenconst char *mailbox_list_get_unexpanded_path(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_path_type type);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenconst char *
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenmailbox_list_get_root_path(const struct mailbox_list_settings *set,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_list_path_type type);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
bf7dc750b95039981c0e9d728f313d50cf38a156Martti Rannanjärviint mailbox_list_delete_index_control(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_iter_update(struct mailbox_list_iter_update_context *ctx,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenbool mailbox_list_name_is_too_large(const char *name, char sep);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenenum mailbox_list_file_type mailbox_list_get_file_type(const struct dirent *d);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenbool mailbox_list_try_get_absolute_path(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char **name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenint mailbox_list_create_missing_index_dir(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_add_change(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_log_record_type type,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const guid_128_t guid_128);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenint mailbox_list_get_guid_path(struct mailbox_list *list, const char *path,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen guid_128_t guid_128_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_name_get_sha128(const char *name, guid_128_t guid_128_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_clear_error(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_error(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mail_error error, const char *string);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_critical(struct mailbox_list *list, const char *fmt, ...)
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen ATTR_FORMAT(2, 3);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_internal_error(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenbool mailbox_list_set_error_from_errno(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
f3fa33be556fd5199dcc856b02b58128bdf693a5Timo Sirainen#endif
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen