mailbox-list-private.h revision 458752f9e9012482843b92379bcfebecfe26f360
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define MAILBOX_LIST_NAME_MAILDIRPLUSPLUS "maildir++"
551fef69c0633ae3c7738038e047a7c0762d9599Timo Sirainen#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen (((flags) & (MAILBOX_SELECT | MAILBOX_NOSELECT | \
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Creating a mailbox */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Create a \Noselect or a mailbox */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* Create a \Noselect or fail */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*get_storage)(struct mailbox_list **list, const char *vname,
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 char (*get_hierarchy_sep)(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *(*get_vname)(struct mailbox_list *list,
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 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 *const *patterns,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen (*iter_next)(struct mailbox_list_iterate_context *ctx);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*iter_deinit)(struct mailbox_list_iterate_context *ctx);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*get_mailbox_flags)(struct mailbox_list *list,
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 /* 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 int (*set_subscribed)(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen int (*create_mailbox_dir)(struct mailbox_list *list, const char *name,
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 unsigned int id;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen/* private: */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* -1 if not set yet. use mailbox_list_get_permissions() to set them */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen /* origin (e.g. path) where the file_create_gid was got from */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen time_t subscriptions_mtime, subscriptions_read_time;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen ARRAY_DEFINE(module_contexts, union mailbox_list_module_context *);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen struct mailbox_list_iterate_context *iter_ctx;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen enum mailbox_info_flags leaf_flags, parent_flags;
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 Sirainenint mailbox_list_settings_parse(struct mail_user *user, const char *data,
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 Sirainenconst char *mailbox_list_get_unexpanded_path(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenmailbox_list_get_root_path(const struct mailbox_list_settings *set,
bf7dc750b95039981c0e9d728f313d50cf38a156Martti Rannanjärviint mailbox_list_delete_index_control(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_iter_update(struct mailbox_list_iter_update_context *ctx,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen const char *name);
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 Sirainenvoid mailbox_list_add_change(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenint mailbox_list_get_guid_path(struct mailbox_list *list, const char *path,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_name_get_sha128(const char *name, guid_128_t guid_128_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_clear_error(struct mailbox_list *list);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_error(struct mailbox_list *list,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_critical(struct mailbox_list *list, const char *fmt, ...)
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid mailbox_list_set_internal_error(struct mailbox_list *list);