No longer able to delete mails via IMAP

No longer able to delete mails via IMAP

Hi,

the mail client I am using is no longer able to delete mails via IMAP resulting in all my mails being fetched over and over again. This has been working for years without problems but suddenly stopped working today.

After having investigated it turns out that my client issues a STORE FLAGS command to replace all FLAGS with "\Deleted \Seen" before doing an EXPUNGE as any normal IMAP client would.
As per RFC3501 your server responds with a FETCH with status OK, however, the flags are not replaced as expected - nothing changes.
Sending STORE +FLAGS instead works as expected and does correctly add the flags.

Please see the following debug session using Python imaplib:
  1. >>> c = imaplib.IMAP4_SSL("imap.zoho.com")
  2. >>> c.login("username", "password")
  3. ('OK', ['Success'])

  4. >>> c.select('INBOX')
  5. ('OK', ['1'])

  6. >>> c.fetch('1', '(UID FLAGS)')
  7. ('OK', ['1 (FLAGS (\\Recent NONJUNK) UID 9)'])

  8. >>> c.uid('STORE', 9, 'FLAGS', '(\Deleted \Seen)')
  9. ('OK', ['1 (FLAGS (\\Recent NONJUNK) UID 9)'])

  10. >>> c.uid('STORE', 9, '+FLAGS', '(\Deleted \Seen)')
  11. ('OK', ['1 (FLAGS (\\Deleted \\Recent \\Seen NONJUNK) UID 9)'])

The offending lines are 11+12. Why is your server not adding \Deleted \Seen (\Recent is not affected by STORE FLAGS as per the RFC)?

Kind regards,