doveadm-mail.h revision 2a15ce3abe14099b94535f6dfc2d4ee023a7c455
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen bool (*parse_arg)(struct doveadm_mail_cmd_context *ctx,int c);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen void (*preinit)(struct doveadm_mail_cmd_context *ctx);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen void (*init)(struct doveadm_mail_cmd_context *ctx,
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen const char *const args[]);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen int (*get_next_user)(struct doveadm_mail_cmd_context *ctx,
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen const char **username_r);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen int (*prerun)(struct doveadm_mail_cmd_context *ctx,
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen struct mail_storage_service_user *service_user,
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen const char **error_r);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen int (*run)(struct doveadm_mail_cmd_context *ctx,
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen void (*deinit)(struct doveadm_mail_cmd_context *ctx);
4082d5b171d1c3a00ba705093d62b8afc9cf17aeTimo Sirainen unsigned int id;
d06d6667bac64aabe1efb216af56ca45108d63b0Timo Sirainen const char *const *args;
d06d6667bac64aabe1efb216af56ca45108d63b0Timo Sirainen /* args including -options */
d06d6667bac64aabe1efb216af56ca45108d63b0Timo Sirainen const char *const *full_args;
86bde2c1838d1ce967fa2b394bb952004a4adcb7Timo Sirainen enum mail_storage_service_flags service_flags;
86bde2c1838d1ce967fa2b394bb952004a4adcb7Timo Sirainen struct mail_storage_service_ctx *storage_service;
86bde2c1838d1ce967fa2b394bb952004a4adcb7Timo Sirainen struct mail_storage_service_input storage_service_input;
d06d6667bac64aabe1efb216af56ca45108d63b0Timo Sirainen /* search args aren't set for all mail commands */
c8bac7666cdc780a3390110e420350fffb62b909Timo Sirainen struct mail_storage_service_user *cur_service_user;
d06d6667bac64aabe1efb216af56ca45108d63b0Timo Sirainen ARRAY(union doveadm_mail_cmd_module_context *) module_contexts;
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainen /* if non-zero, exit with this code */
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainen /* This command is being called by a remote doveadm client. */
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainen /* We're handling only a single user */
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainen /* We're going through all users (not set for wildcard usernames) */
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainen struct doveadm_mail_cmd_context *(*alloc)(void);
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo SirainenARRAY_DEFINE_TYPE(doveadm_mail_cmd, struct doveadm_mail_cmd);
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainenextern ARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainenextern void (*hook_doveadm_mail_init)(struct doveadm_mail_cmd_context *ctx);
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainenextern struct doveadm_mail_cmd_module_register doveadm_mail_cmd_module_register;
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainenbool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[]);
199566f5a171b2c43b9a5254634f6bf47b8baca8Timo Sirainenvoid doveadm_mail_register_cmd(const struct doveadm_mail_cmd *cmd);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenconst struct doveadm_mail_cmd *doveadm_mail_cmd_find(const char *cmd_name);
ba66ac5557ca97d8a6fe5d524056264a9f92243cPhil Carmodyvoid doveadm_mail_help(const struct doveadm_mail_cmd *cmd) ATTR_NORETURN;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenvoid doveadm_mail_help_name(const char *cmd_name) ATTR_NORETURN;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenvoid doveadm_mail_try_help_name(const char *cmd_name);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenbool doveadm_mail_has_subcommands(const char *cmd_name);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainendoveadm_mail_cmd_init(const struct doveadm_mail_cmd *cmd,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenint doveadm_mail_single_user(struct doveadm_mail_cmd_context *ctx,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainen const struct mail_storage_service_input *input,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainen const char **error_r);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenint doveadm_mail_server_user(struct doveadm_mail_cmd_context *ctx,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainen const struct mail_storage_service_input *input,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainen const char **error_r);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainendoveadm_mailbox_find(struct mail_user *user, const char *mailbox);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenint doveadm_mailbox_find_and_sync(struct mail_user *user, const char *mailbox,
ba66ac5557ca97d8a6fe5d524056264a9f92243cPhil Carmodydoveadm_mail_build_search_args(const char *const args[]);
ba66ac5557ca97d8a6fe5d524056264a9f92243cPhil Carmodyvoid doveadm_mailbox_args_check(const char *const args[]);
ba66ac5557ca97d8a6fe5d524056264a9f92243cPhil Carmodydoveadm_mail_mailbox_search_args_build(const char *const args[]);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenvoid expunge_search_args_check(struct mail_search_args *args, const char *cmd);
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainen (type *)doveadm_mail_cmd_alloc_size(sizeof(type))
461ffead9720d1e516b959d5e41f049c73d38c7cTimo Sirainenvoid doveadm_mail_failed_error(struct doveadm_mail_cmd_context *ctx,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenvoid doveadm_mail_failed_storage(struct doveadm_mail_cmd_context *ctx,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenvoid doveadm_mail_failed_mailbox(struct doveadm_mail_cmd_context *ctx,
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_list;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_create;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_delete;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_rename;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_subscribe;
48acc31adebfdd4e4945ee76e1f5259e4b1b6fffTimo Sirainenextern struct doveadm_mail_cmd cmd_mailbox_unsubscribe;