doveadm-mail.h revision 0368f3b0ae3fc1ea892da5c5ec02c05c0c3989af
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch#ifndef DOVEADM_MAIL_H
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#define DOVEADM_MAIL_H
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#include <stdio.h>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#include "doveadm.h"
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi#include "doveadm-util.h"
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#include "module-context.h"
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi#include "mail-error.h"
c5f932968281763df360b9c97cef60f5f80d5e3dTimo Sirainen#include "mail-storage-service.h"
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct mailbox;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct mailbox_list;
d951320d498ae0800b677b754dde71574102123bTimo Sirainenstruct mail_storage;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct mail_user;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct doveadm_mail_cmd_context;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct doveadm_mail_cmd_vfuncs {
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Parse one getopt() parameter. This is called for each parameter. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen bool (*parse_arg)(struct doveadm_mail_cmd_context *ctx, int c);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Usually not needed. The preinit() is called just after parsing all
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen parameters, but before any userdb lookups are done. This allows the
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen preinit() to alter the userdb lookup behavior (especially
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen service_flags). */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen void (*preinit)(struct doveadm_mail_cmd_context *ctx);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Initialize the command. Most importantly if the function prints
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen anything, this should initialize the headers. It shouldn't however
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen do any actual work. The init() is called also when doveadm is
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen performing the work via doveadm-server, which could be running
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen remotely with completely different Dovecot configuration. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen void (*init)(struct doveadm_mail_cmd_context *ctx,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *const args[]);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Usually not needed. When iterating through multiple users, use this
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen function to get the next username. Overriding this is usually done
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen only when there's a known username filter, such as the expire
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen plugin. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen int (*get_next_user)(struct doveadm_mail_cmd_context *ctx,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char **username_r);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* Usually not needed. This is called between
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen mail_storage_service_lookup() and mail_storage_service_next() for
a21f618de284dc22a480af1371d5f5cea50a39dfTimo Sirainen each user. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen int (*prerun)(struct doveadm_mail_cmd_context *ctx,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_storage_service_user *service_user,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char **error_r);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* This is the main function which performs all the work for the
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen command. This is called once per each user. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen int (*run)(struct doveadm_mail_cmd_context *ctx,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_user *mail_user);
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen /* Deinitialize the command. Called once at the end - even if
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen preinit() or init() was never called. */
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen void (*deinit)(struct doveadm_mail_cmd_context *ctx);
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen};
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainenstruct doveadm_mail_cmd_module_register {
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen unsigned int id;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen};
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenunion doveadm_mail_cmd_module_context {
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct doveadm_mail_cmd_vfuncs super;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct doveadm_mail_cmd_module_register *reg;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen};
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainenstruct doveadm_mail_cmd_context {
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen pool_t pool;
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen const struct doveadm_mail_cmd *cmd;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *const *args;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* args including -options */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *const *full_args;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* connection via doveadm-server */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct client_connection *conn;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *getopt_args;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const struct doveadm_settings *set;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen enum mail_storage_service_flags service_flags;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_storage_service_ctx *storage_service;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_storage_service_input storage_service_input;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* search args aren't set for all mail commands */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_search_args *search_args;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct istream *users_list_input;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct ip_addr cur_client_ip;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *cur_username;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_storage_service_user *cur_service_user;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct mail_user *cur_mail_user;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct doveadm_mail_cmd_vfuncs v;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct istream *cmd_input;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen int cmd_input_fd;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen ARRAY(union doveadm_mail_cmd_module_context *) module_contexts;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* if non-zero, exit with this code */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen int exit_code;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* This command is being called by a remote doveadm client. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen unsigned int proxying:1;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* We're handling only a single user */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen unsigned int iterate_single_user:1;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen /* We're going through all users (not set for wildcard usernames) */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen unsigned int iterate_all_users:1;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen};
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct doveadm_mail_cmd {
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen struct doveadm_mail_cmd_context *(*alloc)(void);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *name;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *usage_args;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen};
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenARRAY_DEFINE_TYPE(doveadm_mail_cmd, struct doveadm_mail_cmd);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern ARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern void (*hook_doveadm_mail_init)(struct doveadm_mail_cmd_context *ctx);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_mail_cmd_module_register doveadm_mail_cmd_module_register;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern char doveadm_mail_cmd_hide;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenbool doveadm_is_killed(void);
a5b64f1abb1cb0a9718d5bf7f0ae808072237259Timo Sirainenint doveadm_killed_signo(void);
a5b64f1abb1cb0a9718d5bf7f0ae808072237259Timo Sirainen
a5b64f1abb1cb0a9718d5bf7f0ae808072237259Timo Sirainenbool doveadm_mail_try_run(const char *cmd_name, int argc, char *argv[]);
a5b64f1abb1cb0a9718d5bf7f0ae808072237259Timo Sirainenvoid doveadm_mail_register_cmd(const struct doveadm_mail_cmd *cmd);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenconst struct doveadm_mail_cmd *doveadm_mail_cmd_find(const char *cmd_name);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_usage(string_t *out);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_help(const struct doveadm_mail_cmd *cmd) ATTR_NORETURN;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_help_name(const char *cmd_name) ATTR_NORETURN;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_try_help_name(const char *cmd_name);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenbool doveadm_mail_has_subcommands(const char *cmd_name);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_init(void);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_deinit(void);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenconst struct doveadm_mail_cmd *
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainendoveadm_mail_cmd_find_from_argv(const char *cmd_name, int *argc,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen const char *const **argv);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct doveadm_mail_cmd_context *
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainendoveadm_mail_cmd_init(const struct doveadm_mail_cmd *cmd,
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi const struct doveadm_settings *set);
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomiint doveadm_mail_single_user(struct doveadm_mail_cmd_context *ctx,
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi const struct mail_storage_service_input *input,
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi const char **error_r);
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomiint doveadm_mail_server_user(struct doveadm_mail_cmd_context *ctx,
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi const struct mail_storage_service_input *input,
d48e40d6c77d673ad402d96571198d1cce4da225Timo Sirainen const char **error_r);
b78d8dbe4179aabcbf9fda41d282673558dae4d6Timo Sirainenvoid doveadm_mail_server_flush(void);
b78d8dbe4179aabcbf9fda41d282673558dae4d6Timo Sirainen
b78d8dbe4179aabcbf9fda41d282673558dae4d6Timo Sirainen/* Request input stream to be read (from stdin). This must be called from
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen the command's init() function. */
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_get_input(struct doveadm_mail_cmd_context *ctx);
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomistruct mailbox *
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomidoveadm_mailbox_find(struct mail_user *user, const char *mailbox);
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomistruct mail_search_args *
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomidoveadm_mail_build_search_args(const char *const args[]);
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomivoid doveadm_mailbox_args_check(const char *const args[]);
a327d9301f593433c228c4cc8cca05c95b37f6fbTimo Sirainenstruct mail_search_args *
8a4a0ef8264d95ffb2ba8f6f109f94ea7f3454e8Timo Sirainendoveadm_mail_mailbox_search_args_build(const char *const args[]);
d48e40d6c77d673ad402d96571198d1cce4da225Timo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid expunge_search_args_check(struct mail_search_args *args, const char *cmd);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenstruct doveadm_mail_cmd_context *
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainendoveadm_mail_cmd_alloc_size(size_t size);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#define doveadm_mail_cmd_alloc(type) \
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen (type *)doveadm_mail_cmd_alloc_size(sizeof(type))
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_failed_error(struct doveadm_mail_cmd_context *ctx,
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen enum mail_error error);
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvoid doveadm_mail_failed_storage(struct doveadm_mail_cmd_context *ctx,
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainen struct mail_storage *storage);
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenvoid doveadm_mail_failed_mailbox(struct doveadm_mail_cmd_context *ctx,
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainen struct mailbox *box);
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenvoid doveadm_mail_failed_list(struct doveadm_mail_cmd_context *ctx,
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainen struct mailbox_list *list);
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainen
2c5c70e12365d7910848259f88eb237ce3a15947Timo Sirainenextern struct doveadm_mail_cmd cmd_expunge;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_save;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_search;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_fetch;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_flags_add;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_flags_remove;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_flags_replace;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_import;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_index;
7db7fbea5d8a07463b625f93d69166d56018dadfTimo Sirainenextern struct doveadm_mail_cmd cmd_altmove;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_mail_cmd cmd_copy;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_mail_cmd cmd_deduplicate;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_mail_cmd cmd_move;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_mail_cmd cmd_batch;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_metadata_set_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_metadata_unset_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_metadata_get_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_metadata_list_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_status_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_list_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_create_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_delete_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_rename_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_subscribe_ver2;
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenextern struct doveadm_cmd_ver2 doveadm_cmd_mailbox_unsubscribe_ver2;
a618726eb3eb09a3866fe93208baf923d593f4d3Timo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#define DOVEADM_CMD_MAIL_COMMON \
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenDOVEADM_CMD_PARAM("A", "all-users", CMD_PARAM_BOOL, 0) \
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenDOVEADM_CMD_PARAM("S:", "socket-path", CMD_PARAM_STR, 0) \
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenDOVEADM_CMD_PARAM("u:", "user", CMD_PARAM_STR, 0) \
009217abb57a24a4076092e8e4e165545747839eStephan BoschDOVEADM_CMD_PARAM("F:", "user-file", CMD_PARAM_ISTREAM, 0)
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen#endif
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen