The error message blindly skipped over 3 bytes after the tagged "S " reply.
This was okay if the reply was "NO", but wrong if the reply was "BAD". Also
nothing really guarantees that a broken server couldn't have just returned
a truncated "S " string, in which case the error would point to garbage.
/* STARTTLS failed */
const char *reason = t_strdup_printf(
"STARTTLS failed: %s",
- str_sanitize(line + 5, 160));
+ str_sanitize(line + 2, 160));
login_proxy_failed(client->login_proxy,
login_proxy_get_event(client->login_proxy),
LOGIN_PROXY_FAILURE_TYPE_REMOTE, reason);