Dovecot v2.3.15 released

Michael Slusarz michael.slusarz at open-xchange.com
Wed Jun 23 18:14:59 EEST 2021


> On 06/22/2021 10:50 AM Alessio Cecchi <alessio at skye.it> wrote:
> 
>  
> Il 21/06/21 13:18, Timo Sirainen ha scritto:
> >  + imap: Support official RFC8970 preview/snippet syntax. Old methods of
> >    retrieving preview information via IMAP commands ("SNIPPET and PREVIEW
> >    with explicit algorithm selection") have been deprecated.
> 
> Hi,
> 
> After upgrading dovecot from 2.3.14 to 2.3.15 I noticed a problem 
> parsing FETCH response of PREVIEW attribute.
> 
> Basically there is any space after the preview content and the rest of 
> the string which causes issues on parsing:
> 
> a UID FETCH 2539 (MODSEQ UID FLAGS INTERNALDATE PREVIEW 
> BODY.PEEK[HEADER.FIELDS (FROM TO SUBJECT DATE)])
> * 8 FETCH (UID 2539 MODSEQ (3) FLAGS (\Seen $HasNoAttachment) 
> INTERNALDATE "04-Mar-2021 12:18:02 +0100" PREVIEW 
> "test"BODY[HEADER.FIELDS (FROM TO SUBJECT DATE)] {151}
> 
> With dovecot 2.3.14 there was no problem:
> 
> a UID FETCH 2539 (MODSEQ UID FLAGS INTERNALDATE PREVIEW 
> BODY.PEEK[HEADER.FIELDS (FROM TO SUBJECT DATE)])
> * 8 FETCH (UID 2539 MODSEQ (3) FLAGS (\Seen $HasNoAttachment) 
> INTERNALDATE "04-Mar-2021 12:18:02 +0100" PREVIEW (FUZZY "test") 
> BODY[HEADER.FIELDS (FROM TO SUBJECT DATE)] {151}

Yes, this is an unfortunate regression if PREVIEW is not the last FETCH option listed in the command.

Fix is:

diff --git a/src/imap/imap-fetch-body.c b/src/imap/imap-fetch-body.c
index 59a9b24d99..39e66f093d 100644
--- a/src/imap/imap-fetch-body.c
+++ b/src/imap/imap-fetch-body.c
@@ -648,6 +648,7 @@ fetch_snippet(struct imap_fetch_context *ctx, struct mail *mail,
                        str_append(ctx->state.cur_str, "NIL");
            if (preview->old_standard)
                        str_append(ctx->state.cur_str, ")");
+           str_append_c(ctx->state.cur_str, ' ');

            return 1;
  }

michael


More information about the dovecot mailing list