X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fmanagesieve%2Fserv_managesieve.c;h=e085d5991a1691a7988e8df2f4c3f2c8afbef794;hb=e329db30593524cc2d8851a4500bac41f2340354;hp=7158f4c009543ed5b613f5da446c99703ad2c2d7;hpb=63a61517ff2c94c54ff4d071cbd406d135d895d0;p=citadel.git diff --git a/citadel/modules/managesieve/serv_managesieve.c b/citadel/modules/managesieve/serv_managesieve.c index 7158f4c00..e085d5991 100644 --- a/citadel/modules/managesieve/serv_managesieve.c +++ b/citadel/modules/managesieve/serv_managesieve.c @@ -6,7 +6,7 @@ * as this draft expires with this writing, you might need to search for * the new one. * - * Copyright (c) 2007-2012 by the citadel.org team + * Copyright (c) 2007-2018 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -284,7 +284,7 @@ void cmd_mgsve_auth(int num_parms, char **parms, struct sdm_userdata *u) if ((*username == '\0') && (*(username + 1) != '\0')) username ++; - if (login_ok == CtdlLoginExistingUser(NULL, username)) + if (login_ok == CtdlLoginExistingUser(username)) { char *pass; @@ -507,7 +507,10 @@ void mgsve_auth(char *argbuf) { if (strlen(argbuf) >= 7) { } else { - CtdlEncodeBase64(username_prompt, "Username:", 9, 0); + size_t len = CtdlEncodeBase64(username_prompt, "Username:", 9, 0); + if (username_prompt[len - 1] == '\n') { + username_prompt[len - 1] = '\0'; + } cprintf("334 %s\r\n", username_prompt); } return; @@ -648,7 +651,7 @@ CTDL_MODULE_INIT(managesieve) { if (!threading) { - CtdlRegisterServiceHook(config.c_managesieve_port, + CtdlRegisterServiceHook(CtdlGetConfigInt("c_managesieve_port"), NULL, managesieve_greeting, managesieve_command_loop,