mailbox-list-private.h revision 8ca217bf3aa23c7922d0d4aa44fcd2320416d61c
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#ifndef MAILBOX_LIST_PRIVATE_H
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_PRIVATE_H
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#include "mailbox-log.h"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#include "mailbox-list-notify.h"
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen#include "mail-namespace.h"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#include "mailbox-list.h"
137ea7ca34005345aa2304a940149b7f3774d727Timo Sirainen#include "mailbox-list-iter.h"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#include "mail-storage-settings.h"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_NAME_MAILDIRPLUSPLUS "maildir++"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_NAME_IMAPDIR "imapdir"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_NAME_FS "fs"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_NAME_INDEX "index"
137ea7ca34005345aa2304a940149b7f3774d727Timo Sirainen#define MAILBOX_LIST_NAME_NONE "none"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LIST_INDEX_DEFAULT_PREFIX "dovecot.list.index"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define T_MAILBOX_LIST_ERR_NOT_FOUND(list, name) \
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, \
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen mailbox_list_get_vname(list, name))
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct stat;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct dirent;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct fs;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct imap_match_glob;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_tree_context;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_notify;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_notify_rec;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen#define MAILBOX_INFO_FLAGS_FINISHED(flags) \
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen (((flags) & (MAILBOX_SELECT | MAILBOX_NOSELECT | \
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen MAILBOX_NONEXISTENT)) != 0)
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_vfuncs {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list *(*alloc)(void);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*init)(struct mailbox_list *list, const char **error_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen void (*deinit)(struct mailbox_list *list);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*get_storage)(struct mailbox_list **list, const char *vname,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mail_storage **storage_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen char (*get_hierarchy_sep)(struct mailbox_list *list);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *(*get_vname)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *storage_name);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *(*get_storage_name)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *vname);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*get_path)(struct mailbox_list *list, const char *name,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_path_type type, const char **path_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *(*get_temp_prefix)(struct mailbox_list *list, bool global);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *(*join_refpattern)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *ref, const char *pattern);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_iterate_context *
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen (*iter_init)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *const *patterns,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_iter_flags flags);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const struct mailbox_info *
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen (*iter_next)(struct mailbox_list_iterate_context *ctx);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*iter_deinit)(struct mailbox_list_iterate_context *ctx);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*get_mailbox_flags)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *dir, const char *fname,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_file_type type,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_info_flags *flags_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen /* Returns TRUE if name is mailbox's internal file/directory.
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen If it does, mailbox deletion assumes it can safely delete it. */
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool (*is_internal_name)(struct mailbox_list *list, const char *name);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen /* Read subscriptions from src_list, but place them into
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen dest_list->subscriptions. Set errors to dest_list. */
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*subscriptions_refresh)(struct mailbox_list *src_list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list *dest_list);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*set_subscribed)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *name, bool set);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*delete_mailbox)(struct mailbox_list *list, const char *name);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*delete_dir)(struct mailbox_list *list, const char *name);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*delete_symlink)(struct mailbox_list *list, const char *name);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*rename_mailbox)(struct mailbox_list *oldlist, const char *oldname,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list *newlist, const char *newname);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*notify_init)(struct mailbox_list *list,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_notify_event mask,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_notify **notify_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen int (*notify_next)(struct mailbox_list_notify *notify,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const struct mailbox_list_notify_rec **rec_r);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen void (*notify_deinit)(struct mailbox_list_notify *notify);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen void (*notify_wait)(struct mailbox_list_notify *notify,
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen void (*callback)(void *context), void *context);
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_module_register {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen unsigned int id;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenunion mailbox_list_module_context {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_vfuncs super;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_module_register *reg;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const char *name;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_properties props;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen size_t mailbox_name_max_length;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_vfuncs v, *vlast;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen/* private: */
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen pool_t pool;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mail_namespace *ns;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_settings set;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen const struct mail_storage_settings *mail_set;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_flags flags;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen /* may not be set yet, use mailbox_list_get_permissions() to access */
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_permissions root_permissions;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_tree_context *subscriptions;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen time_t subscriptions_mtime, subscriptions_read_time;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_log *changelog;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen time_t changelog_timestamp;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen pool_t guid_cache_pool;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen HASH_TABLE(uint8_t *, struct mailbox_guid_cache_rec *) guid_cache;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool guid_cache_errors;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen /* Last error set in mailbox_list_set_critical(). */
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen char *last_internal_error;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen char *error_string;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mail_error error;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool temporary_error;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen ARRAY(union mailbox_list_module_context *) module_contexts;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool index_root_dir_created:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool guid_cache_updated:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool guid_cache_invalidated:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool last_error_is_internal:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenunion mailbox_list_iterate_module_context {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_module_register *reg;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_iterate_context {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list *list;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen pool_t pool;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_list_iter_flags flags;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool failed;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct imap_match_glob *glob;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_info specialuse_info;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen ARRAY(union mailbox_list_iterate_module_context *) module_contexts;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainenstruct mailbox_list_iter_update_context {
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_list_iterate_context *iter_ctx;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct mailbox_tree_context *tree_ctx;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen struct imap_match_glob *glob;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen enum mailbox_info_flags leaf_flags, parent_flags;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool update_only:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen bool match_parents:1;
0c17af9d3f9323136a94e66605776ed4462a172dTimo Sirainen};
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen/* Modules should use do "my_id = mailbox_list_module_id++" and
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen use objects' module_contexts[id] for their own purposes. */
16f816d3f3c32ae3351834253f52ddd0212bcbf3Timo Sirainenextern struct mailbox_list_module_register mailbox_list_module_register;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid mailbox_lists_init(void);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid mailbox_lists_deinit(void);
8e5fedd9ada47735be8ac0f8af2a66e8528bd776Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid mailbox_list_settings_init_defaults(struct mailbox_list_settings *set_r);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenint mailbox_list_settings_parse(struct mail_user *user, const char *data,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen struct mailbox_list_settings *set_r,
5fb3bff645380804c9db2510940c41db6b8fdb01Timo Sirainen const char **error_r);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenconst char *
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenmailbox_list_escape_name(struct mailbox_list *list, const char *vname);
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainenconst char *
2abfef71398a61e5ed97c23a1ceb71461933ccb8Timo Sirainenmailbox_list_escape_name_params(const char *vname, const char *ns_prefix,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen char ns_sep, char list_sep, char escape_char,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen const char *maildir_name);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenconst char *
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenmailbox_list_unescape_name(struct mailbox_list *list, const char *src);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenconst char *
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenmailbox_list_unescape_name_params(const char *src, const char *ns_prefix,
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainen char ns_sep, char list_sep, char escape_char);
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainen
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainenconst char *mailbox_list_default_get_storage_name(struct mailbox_list *list,
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainen const char *vname);
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainenconst char *mailbox_list_default_get_vname(struct mailbox_list *list,
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainen const char *storage_name);
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainenconst char *mailbox_list_get_unexpanded_path(struct mailbox_list *list,
b66a7b7ab0db2c9ad425912d3f21a36fcf76d876Timo Sirainen enum mailbox_list_path_type type);
cbf7138b49d32fce0645dc6523fbb42cc07cb2faTimo Sirainenbool mailbox_list_set_get_root_path(const struct mailbox_list_settings *set,
cbf7138b49d32fce0645dc6523fbb42cc07cb2faTimo Sirainen enum mailbox_list_path_type type,
b9b48aaaebf6f72dfab567cda073cde8a7b26598Timo Sirainen const char **path_r);
b9b48aaaebf6f72dfab567cda073cde8a7b26598Timo Sirainen
992a9e2d6c6ee45d87089ac54267e0198a7802c3Timo Sirainenint mailbox_list_delete_index_control(struct mailbox_list *list,
992a9e2d6c6ee45d87089ac54267e0198a7802c3Timo Sirainen const char *name);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
b5e6f6f27c1461f0f9f202615eeb738a645188c3Timo Sirainenvoid mailbox_list_iter_update(struct mailbox_list_iter_update_context *ctx,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen const char *name);
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainenint mailbox_list_iter_subscriptions_refresh(struct mailbox_list *list);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainenenum mailbox_list_file_type mailbox_list_get_file_type(const struct dirent *d);
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainenint mailbox_list_dirent_is_alias_symlink(struct mailbox_list *list,
d4dcb9c30dba354cff7af6d303ecef7698194c55Timo Sirainen const char *dir_path,
d4dcb9c30dba354cff7af6d303ecef7698194c55Timo Sirainen const struct dirent *d);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenbool mailbox_list_try_get_absolute_path(struct mailbox_list *list,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen const char **name);
9c7e765845357342923e16351181091028e5930fTimo Sirainen
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainenvoid mailbox_list_add_change(struct mailbox_list *list,
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen enum mailbox_log_record_type type,
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen const guid_128_t guid_128);
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainenvoid mailbox_name_get_sha128(const char *name, guid_128_t guid_128_r);
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainen
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainenvoid mailbox_list_clear_error(struct mailbox_list *list);
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainenvoid mailbox_list_set_error(struct mailbox_list *list,
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainen enum mail_error error, const char *string);
6bf1543bb7af03324c04e8f9ac8e430f395989aeTimo Sirainenvoid mailbox_list_set_critical(struct mailbox_list *list, const char *fmt, ...)
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen ATTR_FORMAT(2, 3);
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainenvoid mailbox_list_set_internal_error(struct mailbox_list *list);
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainenbool mailbox_list_set_error_from_errno(struct mailbox_list *list);
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen#endif
44dc970b18c4e2d06f34cb908924152156e4a45bTimo Sirainen