if (mail_storage_service_lookup(storage_service, &input,
&service_user, &error) <= 0)
i_fatal("User lookup failed: %s", error);
- if (mail_storage_service_next(storage_service, service_user,
- &mail_user) < 0)
- i_fatal("User init failed");
if (remote_cmd_args != NULL) {
- /* user initialization may exec doveconf, so do our forking
- after that */
+ /* _service_lookup() may exec doveconf, so do our forking
+ after that. but do it before _service_next() in case it
+ drops process privileges */
run_cmd(remote_cmd_args, &fd_in, &fd_out);
}
+ if (mail_storage_service_next(storage_service, service_user,
+ &mail_user) < 0)
+ i_fatal("User init failed");
+
/* create the first local worker */
worker1 = dsync_worker_init_local(mail_user, alt_char);
if (local_location != NULL) {