imapc tries to fetch uid 0
Timo Sirainen
tss at iki.fi
Tue Mar 29 17:41:01 UTC 2016
> On 19 Feb 2016, at 17:12, Nagy, Attila <bra at fsn.hu> wrote:
>
> Hi,
>
> This is a capture from an imapc client session (which is triggered by a message, received via LMTP):
> * OK [CAPABILITY IMAP4rev1 NAMESPACE] Ready
> 2 LOGIN "uid" "pass"
> 2 OK LOGIN succeeded
> 1 LIST "" ""
> * LIST (\Noselect) "/" ""
> 1 OK LIST completed
> 3 APPEND "INBOX" {568}
> + Ready for 568 octets of data
> [...]
> 3 OK APPEND complete
> 4 EXAMINE "INBOX"
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
> * 4 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1455885804]
> * OK [UIDNEXT 5]
> 4 OK [READ-ONLY] EXAMINE successful
> 5 UID FETCH 0 (RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Message-ID)])
> 5 BAD Illegal syntax: Bad message number 0
>
> Dovecot 2.2.21
>
> I don't see any problems with the conversation otherwise. Is it safe to assume this is a bug in imapc?
doveconf -n would be helpful. I guess you have mail_log plugin enabled? And imapc isn't used with any index directory? So Dovecot attempts to log Message-ID and size after saving a mail, but those aren't in cache (because indexes are disabled) and the transaction isn't committed yet either so the mail has no UID.
So the only fix for now that I can do is to just not send the FETCH command and instead fail it immediately:
https://github.com/dovecot/core/commit/969f57f722570982a5febbaab2462b692aa68733
Any further fixing would become difficult.
More information about the dovecot
mailing list