On 25/08/2025 12:48, Akos Szo"ts via dovecot wrote:

    Hi everyone,

    These two IMAP search commands return different values:

    a SEARCH UNSEEN
    * SEARCH 38 61 62 63 65 69 74 75 76 82 86 87 102 120 121 141 142 143 144
    145 146 158 159 160

    a SEARCH UNKEYWORD \Seen
    * SEARCH [All email IDs in the mailbox]

    a SEARCH KEYWORD \Seen
    * SEARCH [Empty]

    According to [1]RFC 3501, in my interpretation, these two should be equal:

    >      UNSEEN
    >         Messages that do not have the \Seen flag set.

    Can you tell me what is causing this difference? I also ran force-resync
    on all my mails, just to be sure.

    Akos

   Hi Akos

   keywords are a specific type of flag. As defined by the RFC:

 A keyword is defined by the server implementation.  Keywords do not
    begin with "\".

 My interpretation is that for searching for \Seen or \Unseen you should use 
the SEEN or UNSEEN search criteria and not the KEYWORD or UNKEYWORD criteria.

 John
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to