cf9d62fd0b143efa8e49fac998eb78a648cdd8a9 0 iEYEABECAAYFAlDqjXUACgkQyUhSUUBViskUEwCfYTWHeDmPr8HfxSBQN17SD5IwDygAnROhb3IVTm9niDun4gxPxbHLo/Pe
b314c97d4bbffd01b20f8492592aa422c13e3d55 0 iEYEABECAAYFAlEJlGMACgkQyUhSUUBVismNdQCgggPP/dt1duU1CMYfkpE4Kyc9Ju0An0kphokRqrtppkeqg7pF1JR01Mgq
fc75811f3c08d80ed339cbb4d37c66f549542ba7 0 iEYEABECAAYFAlEU+CEACgkQyUhSUUBViskh9QCgnqPHUkNvtOioWxo4W7fXjCFLVAwAnR9Z26jgBpoejXDkgwT07wdfYiL3
+018de2aa893a040256cb8cd92b1fc9f3f2bbd09f 0 iEYEABECAAYFAlEmOJEACgkQyUhSUUBVismawgCfbfY6KuH+/AauPkRZs4ish20YeV8Ani5DMLh02DUyJvDIpVPJMmTn2Mu/
+ 582108c190f88597c5215279cb66f74673144c9b 0 iEUEABECAAYFAlFd69UACgkQyUhSUUBVisk/aQCYyYU9JcDM3SrTZu1oJuS26IAnZACeM400zLRROTaM6QYBVKTqTnfpuBY=
+508d46f858153c85ae777e87e1c5143a534a51fe 0 iEYEABECAAYFAlErhDkACgkQyUhSUUBViskRdwCeJ61F0qLZ/3xxIQruTujzo0AEWK0An3PH7nkTY7ouyBdUr0QCra5KLXEZ
+e62fa121f4a2db3348fd79bb176dd363cc1224bf 0 iEYEABECAAYFAlErsAwACgkQyUhSUUBVismarACbBffm3XY21sfkTsbmF8o8udtRZk4An0ofYy2VminZ3S8EFApHymk/UpNv
+11bd79bf4866b0d728b25717134a6ba972505746 0 iEYEABECAAYFAlFKFqsACgkQyUhSUUBVismbSwCdHgMYWjcwcTM7fD4v6wTd/8/8ZEsAn2THId1zYspMTEMtDg0rlrvjlht4
741d800a192fa23572bb14196df2a8917cf20614 2.1.11
75bfda4a7c6c9aa04b6a6ef233fc527356171a06 2.1.12
cf9d62fd0b143efa8e49fac998eb78a648cdd8a9 2.1.13
+86bccdf46d172524ca19a1a8a16a50ac30a6743c 2.2.beta1
b314c97d4bbffd01b20f8492592aa422c13e3d55 2.1.14
fc75811f3c08d80ed339cbb4d37c66f549542ba7 2.1.15
+018de2aa893a040256cb8cd92b1fc9f3f2bbd09f 2.2.beta2
+ 582108c190f88597c5215279cb66f74673144c9b 2.1.16
+508d46f858153c85ae777e87e1c5143a534a51fe 2.2.rc1
+e62fa121f4a2db3348fd79bb176dd363cc1224bf 2.2.rc2
+11bd79bf4866b0d728b25717134a6ba972505746 2.2.rc3
AC_DEFINE_UNQUOTED(DOVECOT_STRING, "$PACKAGE_STRING", Dovecot string)
AC_DEFINE_UNQUOTED(DOVECOT_VERSION, "$PACKAGE_VERSION", Dovecot version)
+ AC_DEFINE([DOVECOT_VERSION_MAJOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1]), [Dovecot major version])
+ AC_DEFINE([DOVECOT_VERSION_MINOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\2]), [Dovecot minor version])
+
AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \
sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \
- sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h sys/fs/quota_common.h \
+ sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h \
+ quota.h sys/fs/quota_common.h \
mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
- sys/utsname.h glob.h linux/falloc.h ucred.h)
+ sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h)
dnl * clang check
have_clang=no
return;
}
}
- request->no_password = TRUE;
request->passdb_password = NULL;
- } else if (strcmp(name, "allow_nets") == 0) {
- auth_request_validate_networks(request, value);
+ auth_fields_add(request->extra_fields, name, value, 0);
+ return;
+ } else if (strcmp(name, "passdb_import") == 0) {
+ auth_request_passdb_import(request, value, "", default_scheme);
+ return;
- } else if (strncmp(name, "userdb_", 7) == 0) {
- /* for prefetch userdb */
+ if (strcmp(name, "userdb_userdb_import") == 0) {
+ /* we need can't put the whole userdb_userdb_import
+ value to extra_cache_fields or it doesn't work
+ properly. so handle this explicitly. */
+ auth_request_passdb_import(request, value,
+ "userdb_", default_scheme);
+ return;
+ }
- if (request->userdb_reply == NULL)
- auth_request_init_userdb_reply(request);
- auth_request_set_userdb_field(request, name + 7, value);
} else {
/* these fields are returned to client */
- auth_request_set_reply_field(request, name, value);
+ auth_fields_add(request->extra_fields, name, value, 0);
return;
}
--- /dev/null
- ARRAY_DEFINE(commands, struct doveadm_mail_cmd_context *);
+ /* Copyright (c) 2012 Dovecot authors, see the included COPYING file */
+
+ #include "lib.h"
+ #include "array.h"
+ #include "doveadm-mail.h"
+
+ #include <unistd.h>
+
+ struct batch_cmd_context {
+ struct doveadm_mail_cmd_context ctx;
++ ARRAY(struct doveadm_mail_cmd_context *) commands;
+ };
+
+ static int cmd_batch_prerun(struct doveadm_mail_cmd_context *_ctx,
+ struct mail_storage_service_user *service_user,
+ const char **error_r)
+ {
+ struct batch_cmd_context *ctx = (struct batch_cmd_context *)_ctx;
+ struct doveadm_mail_cmd_context *const *cmdp;
+ int ret = 0;
+
+ array_foreach(&ctx->commands, cmdp) {
+ if ((*cmdp)->v.prerun != NULL &&
+ (*cmdp)->v.prerun(*cmdp, service_user, error_r) < 0) {
+ ret = -1;
+ break;
+ }
+ }
+ return ret;
+ }
+
+ static int cmd_batch_run(struct doveadm_mail_cmd_context *_ctx,
+ struct mail_user *user)
+ {
+ struct batch_cmd_context *ctx = (struct batch_cmd_context *)_ctx;
+ struct doveadm_mail_cmd_context *const *cmdp;
+ int ret = 0;
+
+ array_foreach(&ctx->commands, cmdp) {
+ if ((*cmdp)->v.run(*cmdp, user) < 0) {
+ ret = -1;
+ break;
+ }
+ }
+ return ret;
+ }
+
+ static void
+ cmd_batch_add(struct batch_cmd_context *batchctx,
+ int argc, const char *const *argv)
+ {
+ struct doveadm_mail_cmd_context *subctx;
+ const struct doveadm_mail_cmd *cmd;
+ const char *getopt_args;
+ int c;
+
+ cmd = doveadm_mail_cmd_find_from_argv(argv[0], &argc, &argv);
+ if (cmd == NULL) {
+ i_fatal_status(EX_USAGE, "doveadm batch: Unknown subcommand %s",
+ argv[1]);
+ }
+
+ subctx = doveadm_mail_cmd_init(cmd, doveadm_settings);
+ subctx->full_args = argv + 1;
+ subctx->service_flags |= batchctx->ctx.service_flags;
+
+ optind = 1;
+ getopt_args = subctx->getopt_args != NULL ? subctx->getopt_args : "";
+ while ((c = getopt(argc, (void *)argv, getopt_args)) > 0) {
+ if (subctx->v.parse_arg == NULL ||
+ !subctx->v.parse_arg(subctx, c))
+ doveadm_mail_help(cmd);
+ }
+ argv += optind;
+ if (argv[0] != NULL && cmd->usage_args == NULL) {
+ i_fatal_status(EX_USAGE, "doveadm %s: Unknown parameter: %s",
+ cmd->name, argv[0]);
+ }
+ subctx->args = argv;
+ if (subctx->v.preinit != NULL)
+ subctx->v.preinit(subctx);
+ array_append(&batchctx->commands, &subctx, 1);
+ }
+
+ static void
+ cmd_batch_preinit(struct doveadm_mail_cmd_context *_ctx)
+ {
+ const char *const *args = _ctx->args;
+ struct batch_cmd_context *ctx = (struct batch_cmd_context *)_ctx;
+ ARRAY_TYPE(const_string) sep_args;
+ const char *sep = args[0];
+ unsigned int i, start;
+ int argc;
+ const char *const *argv;
+
+ if (sep == NULL || args[1] == NULL)
+ doveadm_mail_help_name("batch");
+ args++;
+
+ p_array_init(&ctx->commands, _ctx->pool, 8);
+ p_array_init(&sep_args, _ctx->pool, 16);
+ for (i = start = 0;; i++) {
+ if (args[i] != NULL && strcmp(args[i], sep) != 0) {
+ array_append(&sep_args, &args[i], 1);
+ continue;
+ }
+ if (i > start) {
+ (void)array_append_space(&sep_args);
+ argc = i - start;
+ argv = array_idx(&sep_args, start);
+ cmd_batch_add(ctx, argc, argv);
+ start = i+1;
+ }
+ if (args[i] == NULL)
+ break;
+ }
+ (void)array_append_space(&sep_args);
+ }
+
+ static void
+ cmd_batch_init(struct doveadm_mail_cmd_context *_ctx,
+ const char *const args[] ATTR_UNUSED)
+ {
+ struct batch_cmd_context *ctx = (struct batch_cmd_context *)_ctx;
+ struct doveadm_mail_cmd_context *const *cmdp;
+ struct batch_cmd_context *subctx;
+
+ array_foreach(&ctx->commands, cmdp) {
+ subctx = (struct batch_cmd_context *)*cmdp;
+ subctx->ctx.storage_service = _ctx->storage_service;
+ if (subctx->ctx.v.init != NULL)
+ subctx->ctx.v.init(&subctx->ctx, subctx->ctx.args);
+ }
+ }
+
+ static void cmd_batch_deinit(struct doveadm_mail_cmd_context *_ctx)
+ {
+ struct batch_cmd_context *ctx = (struct batch_cmd_context *)_ctx;
+ struct doveadm_mail_cmd_context *const *cmdp;
+
+ array_foreach(&ctx->commands, cmdp) {
+ if ((*cmdp)->v.deinit != NULL)
+ (*cmdp)->v.deinit(*cmdp);
+ }
+ }
+
+ static struct doveadm_mail_cmd_context *cmd_batch_alloc(void)
+ {
+ struct batch_cmd_context *ctx;
+
+ ctx = doveadm_mail_cmd_alloc(struct batch_cmd_context);
+ ctx->ctx.v.preinit = cmd_batch_preinit;
+ ctx->ctx.v.init = cmd_batch_init;
+ ctx->ctx.v.prerun = cmd_batch_prerun;
+ ctx->ctx.v.run = cmd_batch_run;
+ ctx->ctx.v.deinit = cmd_batch_deinit;
+ return &ctx->ctx;
+ }
+
+ struct doveadm_mail_cmd cmd_batch = {
+ cmd_batch_alloc, "batch", "<sep> <cmd1> [<sep> <cmd2> [..]]"
+ };
void doveadm_mail_failed_mailbox(struct doveadm_mail_cmd_context *ctx,
struct mailbox *box);
-struct doveadm_mail_cmd cmd_expunge;
-struct doveadm_mail_cmd cmd_search;
-struct doveadm_mail_cmd cmd_fetch;
-struct doveadm_mail_cmd cmd_import;
-struct doveadm_mail_cmd cmd_index;
-struct doveadm_mail_cmd cmd_altmove;
-struct doveadm_mail_cmd cmd_copy;
-struct doveadm_mail_cmd cmd_move;
-struct doveadm_mail_cmd cmd_mailbox_list;
-struct doveadm_mail_cmd cmd_mailbox_create;
-struct doveadm_mail_cmd cmd_mailbox_delete;
-struct doveadm_mail_cmd cmd_mailbox_rename;
-struct doveadm_mail_cmd cmd_mailbox_subscribe;
-struct doveadm_mail_cmd cmd_mailbox_unsubscribe;
-struct doveadm_mail_cmd cmd_mailbox_status;
+extern struct doveadm_mail_cmd cmd_expunge;
+extern struct doveadm_mail_cmd cmd_search;
+extern struct doveadm_mail_cmd cmd_fetch;
+extern struct doveadm_mail_cmd cmd_import;
+extern struct doveadm_mail_cmd cmd_index;
+extern struct doveadm_mail_cmd cmd_altmove;
+extern struct doveadm_mail_cmd cmd_copy;
+extern struct doveadm_mail_cmd cmd_move;
+extern struct doveadm_mail_cmd cmd_mailbox_list;
+extern struct doveadm_mail_cmd cmd_mailbox_create;
+extern struct doveadm_mail_cmd cmd_mailbox_delete;
+extern struct doveadm_mail_cmd cmd_mailbox_rename;
+extern struct doveadm_mail_cmd cmd_mailbox_subscribe;
+extern struct doveadm_mail_cmd cmd_mailbox_unsubscribe;
+extern struct doveadm_mail_cmd cmd_mailbox_status;
+ struct doveadm_mail_cmd cmd_batch;
#endif
#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
-enum mailbox_log_record_type;
+ #define T_MAILBOX_LIST_ERR_NOT_FOUND(list, name) \
+ t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, \
+ mailbox_list_get_vname(list, name))
+
struct stat;
struct dirent;
struct imap_match_glob;