From: Jeremy Harris Date: Sun, 21 May 2017 15:42:05 +0000 (+0100) Subject: Debug: more info during server-side authentication X-Git-Tag: exim-4_90_RC1~152 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8b6b06fe3e009cb89ae7923b890e75f9dcd50118;p=exim.git Debug: more info during server-side authentication --- diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 5ff1b7f32..0ffa21939 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -4230,26 +4230,34 @@ while (done <= 0) auth_instance *au; BOOL first = TRUE; for (au = auths; au; au = au->next) - if (au->server && (au->advertise_condition == NULL || - expand_check_condition(au->advertise_condition, au->name, - US"authenticator"))) + { + au->advertised = FALSE; + if (au->server) { - int saveptr; - if (first) + DEBUG(D_auth+D_expand) debug_printf_indent( + "Evaluating advertise_condition for %s athenticator\n", + au->public_name); + if ( !au->advertise_condition + || expand_check_condition(au->advertise_condition, au->name, + US"authenticator") + ) { - s = string_catn(s, &size, &ptr, smtp_code, 3); - s = string_catn(s, &size, &ptr, US"-AUTH", 5); - first = FALSE; - auth_advertised = TRUE; + int saveptr; + if (first) + { + s = string_catn(s, &size, &ptr, smtp_code, 3); + s = string_catn(s, &size, &ptr, US"-AUTH", 5); + first = FALSE; + auth_advertised = TRUE; + } + saveptr = ptr; + s = string_catn(s, &size, &ptr, US" ", 1); + s = string_cat (s, &size, &ptr, au->public_name); + while (++saveptr < ptr) s[saveptr] = toupper(s[saveptr]); + au->advertised = TRUE; } - saveptr = ptr; - s = string_catn(s, &size, &ptr, US" ", 1); - s = string_cat (s, &size, &ptr, au->public_name); - while (++saveptr < ptr) s[saveptr] = toupper(s[saveptr]); - au->advertised = TRUE; } - else - au->advertised = FALSE; + } if (!first) s = string_catn(s, &size, &ptr, US"\r\n", 2); } diff --git a/test/stderr/3400 b/test/stderr/3400 index 99e927c6b..78b0e158f 100644 --- a/test/stderr/3400 +++ b/test/stderr/3400 @@ -440,6 +440,13 @@ host in "10.0.0.1"? no (end of list) host in "10.0.0.4"? no (end of list) host in "10.0.0.3 : 10.0.0.4"? no (end of list) host in auth_advertise_hosts? yes (matched "10.0.0.5") +Evaluating advertise_condition for mylogin athenticator +Evaluating advertise_condition for PLAIN athenticator +Evaluating advertise_condition for EXPLAIN athenticator +Evaluating advertise_condition for EXPANDED athenticator +Evaluating advertise_condition for EXPANDFAIL athenticator +Evaluating advertise_condition for DEFER athenticator +Evaluating advertise_condition for LOGIN athenticator host in chunking_advertise_hosts? no (end of list) SMTP>> 250-myhost.test.ex Hello CALLER at testing.testing [10.0.0.5] 250-SIZE 52428800