enum server_reply_state state;
+ bool version_received:1;
bool authenticate_sent:1;
bool authenticated:1;
bool streaming:1;
if (!conn->authenticated) {
while((line = i_stream_read_next_line(conn->input)) != NULL) {
- if (strncmp(line, "VERSION\t", 8) == 0) {
+ /* Allow VERSION before or after the "+" or "-" line,
+ because v2.2.33 sent the version after and newer
+ versions send before. */
+ if (!conn->version_received &&
+ strncmp(line, "VERSION\t", 8) == 0) {
if (!version_string_verify_full(line, "doveadm-client",
DOVEADM_SERVER_PROTOCOL_VERSION_MAJOR,
&conn->minor)) {
server_connection_destroy(&conn);
return;
}
+ conn->version_received = TRUE;
continue;
}
if (strcmp(line, "+") == 0) {