diff --git a/mu/mu-cmd-server.cc b/mu/mu-cmd-server.cc index 1ecef7f5..985f7366 100644 --- a/mu/mu-cmd-server.cc +++ b/mu/mu-cmd-server.cc @@ -764,20 +764,6 @@ index_msg_cb (MuIndexStats *stats, void *user_data) return MU_OK; } -static void -set_my_addresses (MuStore *store, const std::vector& addrs) -{ - if (addrs.empty()) - return; - - const char **addresses = g_new0 (const char*, addrs.size() + 1); - for (auto i = 0U; i != addrs.size(); ++i) - addresses[i] = addrs[i].c_str(); - - mu_store_set_personal_addresses (store, (const char**)addresses); - g_free (addresses); // shallow -} - static MuError index_and_maybe_cleanup (MuIndex *index, bool cleanup, bool lazy_check) @@ -808,13 +794,9 @@ index_and_maybe_cleanup (MuIndex *index, bool cleanup, bool lazy_check) static void index_handler (Context& context, const Parameters& params) { + GError *gerr{}; const auto cleanup{get_bool_or(params, "cleanup")}; const auto lazy_check{get_bool_or(params, "lazy-check")}; - const auto my_addresses{get_string_vec(params, "my-addresses")}; - - set_my_addresses(context.store, my_addresses); - - GError *gerr{}; auto index{mu_index_new (context.store, &gerr)}; if (!index) throw Error(Error::Code::Index, &gerr, "failed to create index object"); @@ -1273,10 +1255,11 @@ mu_cmd_server (MuStore *store, MuConfig *opts/*unused*/, GError **err) try return MU_OK; } + install_sig_handler(); std::cout << ";; Welcome to the " << PACKAGE_STRING << " command-server\n" << ";; Use (help) to get a list of commands, (quit) to quit.\n"; - while (!context.do_quit) { + while (!MuTerminate && !context.do_quit) { try { const auto line{read_line(context)}; diff --git a/mu/mu-config.c b/mu/mu-config.c index cc8c92dc..fc2697fc 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -439,8 +439,10 @@ config_options_group_server (void) { GOptionGroup *og; GOptionEntry entries[] = { - {"maildir", 'm', 0, G_OPTION_ARG_FILENAME, &MU_CONFIG.maildir, - "top of the maildir", ""}, + {"my-address", 0, 0, G_OPTION_ARG_STRING_ARRAY, + &MU_CONFIG.my_addresses, + "my e-mail address; can be used multiple times", + "
"}, {"commands", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.commands, "list the available command and their parameters, then exit", NULL}, {NULL, 0, 0, 0, NULL, NULL, NULL} diff --git a/mu4e/mu4e-proc.el b/mu4e/mu4e-proc.el index 1b729aed..66768283 100644 --- a/mu4e/mu4e-proc.el +++ b/mu4e/mu4e-proc.el @@ -255,7 +255,9 @@ Start the process if needed." (let* ((process-connection-type nil) ;; use a pipe (args '("server")) (args (append args (when mu4e-mu-home (list (concat "--muhome=" mu4e-mu-home))))) - (args (append args (list (concat "--maildir=" mu4e-maildir))))) + (args (append args (mapcar (lambda(addr) + (format "--my-address=%s" addr)) + mu4e-user-mail-address-list)))) (setq mu4e~proc-buf "") (setq mu4e~proc-process (apply 'start-process mu4e~proc-name mu4e~proc-name