Skip to content
Snippets Groups Projects
Commit b684406b authored by Stephan Bosch's avatar Stephan Bosch
Browse files

managesieve: Added -t parameter to specify post-login script timeout (Dovecot change).

parent b55a8548
No related branches found
No related tags found
No related merge requests found
......@@ -225,11 +225,15 @@ int main(int argc, char *argv[])
&managesieve_setting_parser_info,
NULL
};
struct master_login_settings login_set;
enum master_service_flags service_flags = 0;
enum mail_storage_service_flags storage_service_flags = 0;
const char *postlogin_socket_path, *username = NULL;
const char *username = NULL;
int c;
memset(&login_set, 0, sizeof(login_set));
login_set.postlogin_timeout_secs = MASTER_POSTLOGIN_TIMEOUT_DEFAULT;
if (IS_STANDALONE() && getuid() == 0 &&
net_getpeername(1, NULL, NULL) == 0) {
printf("NO \"managesieve binary must not be started from "
......@@ -247,9 +251,14 @@ int main(int argc, char *argv[])
}
master_service = master_service_init("managesieve", service_flags,
&argc, &argv, "u:");
&argc, &argv, "t:u:");
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 't':
if (str_to_uint(optarg, &login_set.postlogin_timeout_secs) < 0 ||
login_set.postlogin_timeout_secs == 0)
i_fatal("Invalid -t parameter: %s", optarg);
break;
case 'u':
storage_service_flags |=
MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
......@@ -259,8 +268,12 @@ int main(int argc, char *argv[])
return FATAL_DEFAULT;
}
}
postlogin_socket_path = argv[optind] == NULL ? NULL :
t_abspath(argv[optind]);
login_set.auth_socket_path = t_abspath("auth-master");
if (argv[optind] != NULL)
login_set.postlogin_socket_path = t_abspath(argv[optind]);
login_set.callback = login_client_connected;
login_set.failure_callback = login_client_failed;
master_service_init_finish(master_service);
master_service_set_die_callback(master_service, managesieve_die);
......@@ -287,11 +300,7 @@ int main(int argc, char *argv[])
main_stdio_run(username);
} T_END;
} else {
master_login = master_login_init(master_service,
t_abspath("auth-master"),
postlogin_socket_path,
login_client_connected,
login_client_failed);
master_login = master_login_init(master_service, &login_set);
io_loop_set_running(current_ioloop);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.