JavaMail setFlags on readonly folder

Timo Sirainen tss at iki.fi
Thu Apr 20 23:41:43 EEST 2017


On 20 Apr 2017, at 15.13, Gabriele Bulfon <gbulfon at sonicle.com> wrote:
> 
> Hi,
> I'm facing a strange issue using JavaMail, where Dovecot let me open "READ_WRITE" a folder with readonly ACLs (same happens on other imap servers), but then doesn't issue any error when if try to setFlags(...) on that folder.
> The result is that the code thinks the folder marked the messages (deleted, flagged, etc), while it actually did not.
> Just refreshing the folder from the java client, you get back your original messages as they were before the operation.
> Is there any known issue about this?

Dovecot used to return NO in such case a long time ago, but it caused user-visible errors with some client when accessing a read-only folder. So it was a bit annoying. I'm not sure if it would still happen with commonly used clients.

Also if the client is using STORE without the .SILENT option, it could check whether the STORE really did something by looking at the FETCH (FLAGS) replies. What could be a useful change to Dovecot is that if .SILENT is used and it doesn't do the change as expected, Dovecot could send FETCH (FLAGS) replies using the unchanged flags.



More information about the dovecot mailing list