Question about imap (expunge response)

Bron Gondwana brong at fastmail.fm
Mon Dec 18 07:45:04 EET 2017


Yeah, that smells bogus.  You can't send the EXPUNGE right away, even if
you did the EXPUNGE.  As the server you're required to wait for a
command which allows expunges to happen.  I've double-checked the Cyrus
IMAP server, and we check usinguid to decide if we can tellexpunge at
the end of index_store - aka, only UID STORE will tell the client
EXPUNGE responses.
Unfortunately, this is a pretty common way in which IMAP servers are non-
compliant - immediate EXPUNGE combined with incorrect telling of EXPUNGE
responses.
Having said that, fetchmail is also wrong here:

fetchmail: IMAP> A0008 STORE 1 +FLAGS.SILENT (\Seen \Deleted) fetchmail:
IMAP< * 1 EXPUNGE fetchmail: IMAP< A0008 OK Store completed fetchmail:
IMAP> A0009 EXPUNGE fetchmail: IMAP< A0009 OK EXPUNGE completed
fetchmail: mail expunge mismatch (0 actual != 1 expected)
There is no guarantee that you would get exactly 1 from the EXPUNGE
command.  You could easily have had other messages marked \Deleted, or
even this same message get the \Deleted flag removed by another session
in the gap between A0008 and A0009.
the EXPUNGE could return any response between zero and the number of
messages in the mailbox.  In theory, the number of messages could even
have been increased and then the EXPUNGE removed more than the previous
mailbox size all at once!
Bron.


On Sat, Dec 16, 2017, at 04:18, Kamil Jońca wrote:
> 
> (This is not neccesarily about dovecot, but rather IMAP protocol)
> 
> At https://drive.google.com/open?id=1j3oa5jYeSdiPbgaihq02K-u_vHbZLJZQ> is fetchmail log from my sessinon with polish email provider
> "Wirtualna> Polska"
> As you can se fetchmail logged "* 1 EXPUNGE" as a response to "STORE"> command.
> According to https://tools.ietf.org/html/rfc3501#section-7.4.1
> EXPUNGE must not be sent as response to STORE command.
> Am I right that their imap server is erroneous or am I missing
> something?
> KJ
> 
> 
> --
> http://stopstopnop.pl/stop_stopnop.pl_o_nas.html
> Lonely men seek companionship.  Lonely women sit at home and wait.
> They never meet.

-- 
  Bron Gondwana
  brong at fastmail.fm




More information about the dovecot mailing list