unsigned int len;
const char *mech_name, *error;
- if (client->proxy_backend_capability == NULL) {
+ /* Send CAPABILITY command if we don't know the capabilities yet.
+ Also as kind of a Dovecot-backend workaround if the client insisted
+ on sending CAPABILITY command (even though our banner already sent
+ it), send the (unnecessary) CAPABILITY command to backend as well
+ to avoid sending the CAPABILITY reply twice (untagged and OK resp
+ code). */
+ if (client->proxy_backend_capability == NULL ||
+ client->client_ignores_capability_resp_code) {
str_append(str, "C CAPABILITY\r\n");
if (client->common.proxy_nopipelining) {
/* authenticate only after receiving C OK reply. */