1
/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.11 2009/10/26 13:18:54 nm4 Exp $ */
1
/* $Cambridge: exim/exim-src/src/auths/dovecot.c,v 1.12 2010/03/05 16:11:11 nm4 Exp $ */
4
4
* Copyright (c) 2004 Andrey Panin <pazke@donpac.ru>
209
209
HDEBUG(D_auth) debug_printf("received: %s\n", buffer);
210
210
nargs = strcut(buffer, args, sizeof(args) / sizeof(args[0]));
212
switch (toupper(*args[0])) {
212
/* Code below rewritten by Kirill Miazine (km@krot.org). Only check commands that
213
Exim will need. Original code also failed if Dovecot server sent unknown
214
command. E.g. COOKIE in version 1.1 of the protocol would cause troubles. */
215
if (Ustrcmp(args[0], US"CUID") == 0) {
214
216
CHECK_COMMAND("CUID", 1, 1);
215
217
cuid = Uatoi(args[1]);
219
CHECK_COMMAND("DONE", 0, 0);
218
} else if (Ustrcmp(args[0], US"VERSION") == 0) {
219
CHECK_COMMAND("VERSION", 2, 2);
220
if (Uatoi(args[1]) != VERSION_MAJOR)
221
OUT("authentication socket protocol version mismatch");
222
} else if (Ustrcmp(args[0], US"MECH") == 0) {
224
223
CHECK_COMMAND("MECH", 1, INT_MAX);
225
224
if (strcmpic(US args[1], ablock->public_name) == 0)
230
CHECK_COMMAND("SPID", 1, 1);
234
CHECK_COMMAND("VERSION", 2, 2);
235
if (Uatoi(args[1]) != VERSION_MAJOR)
236
OUT("authentication socket protocol version mismatch");
226
} else if (Ustrcmp(args[0], US"DONE") == 0) {
227
CHECK_COMMAND("DONE", 0, 0);