users@javamail.java.net

Re: got a MessagingException -> parse error: invalid message sequence number

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Tue, 07 Jan 2014 11:08:39 -0800

Marking the message as deleted should not cause this problem unless some
application expunges the message. Assuming your application isn't expunging the
message before it's done with it, you need to consider what you expect to happen
if another client expunges the message while you're using it. You might not
want to mark the message as deleted until after you've saved the updated draft
of the message.

xoot123_at_yahoo.it wrote on 01/07/14 08:14:
> Hello,
> I'm getting a javax.mail.MessagingException: A258 BAD parse error: invalid
> message sequence number: 24.
>
> I found that one possible execution path in our code that leads to this
> exception is when I edit a draft with attachments, delete the original draft,
> and then save the edited draft (so that the original draft doesn't exist
> anymore, but I have all the informations about it in our application
> composition pane).
> This only happens with drafts with attachments, it seems that a reference to
> the original message number is cached by JavaMail, despite the fact that the
> server supports UIDs - and IMHO the original message isn't needed anymore).
> I have no idea if this is a bug, but if I do the same steps with i.e.
> Thunderbird, no error occurs and the edited draft is correctly saved.
>
> As the application I'm working on is very big, I can't provide a small
> example, nor I can ensure this is our own code fault.
> I'm writing here in the hope that you'll be able to tell me whether this is a
> bug or not, so I can narrow down the possible causes (there's another source
> of that exception in our code that I'm not yet able to replicate).
>
>
>
> Thanks in advance.
>
> M. R.