RFC 5258 violation: incomplete response for "LIST ($OPT RECURSIVEMATCH) ..."

Guilhem Moulin guilhem at fripost.org
Tue Nov 12 20:06:23 EET 2019


Hi there,

RFC 5258 (IMAP4 LIST command extensions) defines a ‘RECURSIVEMATCH’
selection option which “forces the server to return information about
parent mailboxes that don't match other selection options, but have some
submailboxes that do.”  (Section 3.5 makes the requirement even clearer.)

However that's not what Dovecot 2.3.7 does.  AFAICT no LIST response is
returned for mailboxes that don't meet the selection criteria, regardless
of whether they have a child that does.  The violation is visible when
reproducing example #9 from Section 5 [0]:

    $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \
        doveadm -c /tmp/dovecot.conf mailbox create foo2 baz2
    $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \
        doveadm -c /tmp/dovecot.conf mailbox create -s \
            foo2/{bar1,bar2} baz2/{bar2,bar22,bar222} eps2 eps2/mamba qux2/bar2
    $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \
        doveadm -c /tmp/dovecot.conf exec imap
    S: * PREAUTH [CAPABILITY IMAP4rev1 … LIST-EXTENDED …] Logged in as user

    C: D01 LIST "" "*"
    S: * LIST (\Noselect \HasChildren) "/" qux2
    S: * LIST (\HasNoChildren) "/" qux2/bar2
    S: * LIST (\HasChildren) "/" eps2
    S: * LIST (\HasNoChildren) "/" eps2/mamba
    S: * LIST (\HasChildren) "/" baz2
    S: * LIST (\HasNoChildren) "/" baz2/bar222
    S: * LIST (\HasNoChildren) "/" baz2/bar22
    S: * LIST (\HasNoChildren) "/" baz2/bar2
    S: * LIST (\HasChildren) "/" foo2
    S: * LIST (\HasNoChildren) "/" foo2/bar2
    S: * LIST (\HasNoChildren) "/" foo2/bar1
    S: * LIST (\HasNoChildren) "/" INBOX
    S: D01 OK List completed (0.006 + 0.000 + 0.005 secs).

    C: D02 LIST (SUBSCRIBED) "" "*"
    S: * LIST (\Subscribed) "/" foo2/bar1
    S: * LIST (\Subscribed) "/" foo2/bar2
    S: * LIST (\Subscribed) "/" baz2/bar2
    S: * LIST (\Subscribed) "/" baz2/bar22
    S: * LIST (\Subscribed) "/" baz2/bar222
    S: * LIST (\Subscribed) "/" eps2
    S: * LIST (\Subscribed) "/" eps2/mamba
    S: * LIST (\Subscribed) "/" qux2/bar2
    S: D02 OK List completed (0.001 + 0.000 secs).

A LIST command with ‘RECURSIVEMATCH SUBSCRIBED’ selection options
produces an incomplete response:

    C: D03 LIST (RECURSIVEMATCH SUBSCRIBED) "" "*"
    S: * LIST (\Subscribed) "/" foo2/bar1
    S: * LIST (\Subscribed) "/" foo2/bar2
    S: * LIST (\Subscribed) "/" baz2/bar2
    S: * LIST (\Subscribed) "/" baz2/bar22
    S: * LIST (\Subscribed) "/" baz2/bar222
    S: * LIST (\Subscribed) "/" eps2 (CHILDINFO ("SUBSCRIBED"))
    S: * LIST (\Subscribed) "/" eps2/mamba
    S: * LIST (\Subscribed) "/" qux2/bar2
    S: D03 OK List completed (0.001 + 0.000 secs).

The following untagged LIST responses for ‘foo2’ and ‘baz2’ are missing.
RFC 5258 mandates their inclusion because even though they're not
subscribed to themselves, they each have (at least) a subscribed child.

    S: * LIST () "/" "foo2" ("CHILDINFO" ("SUBSCRIBED"))
    S: * LIST () "/" "baz2" ("CHILDINFO" ("SUBSCRIBED"))

Cheers,
-- 
Guilhem.

[0] https://tools.ietf.org/html/rfc5258#section-5
-------------- next part --------------
# 2.3.7.2 (3c910f64b): /tmp/dovecot.conf
# Pigeonhole version 0.5.7.2 ()
# OS: Linux 5.2.0-3-amd64 x86_64 Debian bullseye/sid 
# Hostname: odin.guilhem.org
mail_home = /dev/shm/dovecot-test/%u
mail_location = dbox:~/mail
ssl = no
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://dovecot.org/pipermail/dovecot/attachments/20191112/f8827b7b/attachment-0001.sig>


More information about the dovecot mailing list