From: Timo Sirainen Date: Tue, 7 Jul 2026 11:33:40 +0000 (+0300) Subject: [PATCH 3/3] doveadm compress: Delay failing if used COMPRESS algorithm is not support... X-Git-Tag: archive/raspbian/1%2.4.1+dfsg1-6+rpi1+deb13u7^2~119 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2585a1e3350046c32d0a7def01d65597a109f8e0;p=dovecot.git [PATCH 3/3] doveadm compress: Delay failing if used COMPRESS algorithm is not supported locally This command is used in CI tests to verify the server rejects non-DEFLATE algorithm. Gbp-Pq: Name 0003-doveadm-compress-Delay-failing-if-used-COMPRESS-algo.patch --- diff --git a/src/doveadm/doveadm-compress.c b/src/doveadm/doveadm-compress.c index 1a2b556..9b93e68 100644 --- a/src/doveadm/doveadm-compress.c +++ b/src/doveadm/doveadm-compress.c @@ -123,9 +123,14 @@ client_input_get_compress_algorithm(struct client *client, const char *line) if (!str_begins_icase(line, " COMPRESS ", &algorithm)) return FALSE; + /* Look up the local handler needed to (de)compress the stream once the + server accepts. Don't fail here if the mechanism is unknown or not + compiled in: the server may reject it, and this client must still send + the command to let the server do so. If the server unexpectedly + accepts a mechanism we can't handle, we fail then (see server_input()). */ if (compression_lookup_handler(t_str_lcase(algorithm), &client->handler) <= 0) - i_fatal("Unsupported compression mechanism: %s", algorithm); + client->handler = NULL; /* Remember the tag so we can tell whether the server accepted or rejected this COMPRESS command. */ i_free(client->compress_tag); @@ -281,6 +286,8 @@ static void server_input(struct client *client) struct istream *input; struct ostream *output; + if (client->handler == NULL) + i_fatal("Server accepted unsupported compression mechanism"); e_info(client->event, ""); input = client->handler->create_istream(client->input); output = client->handler->