+
+ /* Now that we know we'll continue, we put the received data into $auth<n>,
+ if possible. First, decode it: buffer+4 skips over the SMTP status code. */
+
+ clear_len = auth_b64decode(buffer+4, &clear);
+
+ /* If decoding failed, the default is to terminate the authentication, and
+ return FAIL, with the SMTP response still in the buffer. However, if client_
+ ignore_invalid_base64 is set, we ignore the error, and put an empty string
+ into $auth<n>. */
+
+ if (clear_len < 0)
+ {
+ uschar *save_bad = string_copy(buffer);
+ if (!ob->client_ignore_invalid_base64)
+ {
+ if (smtp_write_command(outblock, FALSE, "*\r\n") >= 0)
+ (void)smtp_read_response(inblock, US buffer, buffsize, '2', timeout);
+ string_format(buffer, buffsize, "Invalid base64 string in server "
+ "response \"%s\"", save_bad);
+ return CANCELLED;
+ }
+ clear = US"";
+ clear_len = 0;
+ }
+
+ if (auth_var_idx < AUTH_VARS)
+ auth_vars[auth_var_idx++] = string_copy(clear);