Discussion:
[VM] messages with invalid UIDs
Uday Reddy
2011-12-28 14:42:15 UTC
Permalink
It would be nice to be able to see which messages it is about to
expunge, I suspect the cached data is getting corrupted (or is it a
server issue) somewhere rather than the message being dodgy. Looking at
the code I see that it is adding a 'stale' label to those messages but I
can't see where to set up a virtual folder to view them
`V l stale' shows them.

This is one of the dark corners of IMAP handling. If everything is
working correctly, the *only* time this warning should arise is when the
IMAP server changes the UIDVALIDITY value. In that case, all the
messages in the cache folder become "stale" and VM will get fresh copies
of everything. In that case, you should answer "yes" to the question
about expunge.

If the message arises in any other situation, you should know that
something has gone wrong and you should be very careful with what you do
next. Two possibilities are:

- VM has successfully recovered from whatever went wrong, and obtained
fresh copies of the messages. In that case, it is fine to delete the
"stale" copies and keep the good copies.

- VM didn't recover from the problems correctly and the "stale" copies
are all that you have. In that case, your safest course of action is to
get rid of your imap-cache folder and let VM rebuild a new cache folder.

Be warned! The IMAP code is not as fault-tolerant as it should be.
Whenever you get vm-imap-protocol error with some other deeper error
buried inside it, you should be wary. It is incredibly hard to write
fault-tolerant code and I can't promise that I got it right. Getting
rid of the imap-cache folder is the safest course of action.

Cheers,
Uday
Robert Marshall
2011-12-28 15:20:19 UTC
Permalink
Post by Uday Reddy
It would be nice to be able to see which messages it is about to
expunge, I suspect the cached data is getting corrupted (or is it a
server issue) somewhere rather than the message being dodgy. Looking
at the code I see that it is adding a 'stale' label to those messages
but I can't see where to set up a virtual folder to view them
`V l stale' shows them.
V C label stale[1] worked for me, V l isn't bound to anything in 8.2.0 (am
about to move to 8.3.0 beta - thanks!)

These appeared to be all messages received this morning and after
reading them and allowing the expunge they appear to still be there :-)

(I see '10 stale deleted messages are ignored' in *Messages* during the save

<good warnings snipped!>

Robert
[1] when I type the return key after the last letter of stale, I briefly
see a no completion available message - do you want a bug report or is
this an unintended consequence
--
La grenouille songe..dans son château d'eau
Links and things http://rmstar.blogspot.com/
Uday Reddy
2011-12-28 16:05:27 UTC
Permalink
Post by Robert Marshall
V C label stale[1] worked for me, V l isn't bound to anything in 8.2.0 (am
about to move to 8.3.0 beta - thanks!)
Yes, it is in today's release. (8.2.0 beta, don't call it 8.3.0 yet!)
Post by Robert Marshall
These appeared to be all messages received this morning and after
reading them and allowing the expunge they appear to still be there :-)
Once they are labelled "stale", they won't get expunged. If you want to
expunge them, you will need to delete them manually and expunge them. But,
as I said, if the stale copies are all that you have, then your folder is an
"inconsistent" state. The best way to fix it is to get rid of the
imap-cache folder and let VM regnerate a new cache folder.
Post by Robert Marshall
(I see '10 stale deleted messages are ignored' in *Messages* during the save
Yes, you will keep on getting those warning messages until you do something
about the stale messages!

Cheers,
Uday
Uday S Reddy
2011-12-28 17:07:02 UTC
Permalink
Post by Uday Reddy
Once they are labelled "stale", they won't get expunged. If you want to
expunge them, you will need to delete them manually and expunge them. But,
as I said, if the stale copies are all that you have, then your folder is an
"inconsistent" state. The best way to fix it is to get rid of the
imap-cache folder and let VM regnerate a new cache folder.
It occurred to me that there is another, slightly less painful way, of
getting your cache folder back into shape.

Visit the IMAP folder normally and run M-x vm-prune-imap-retrieved-list. It
will ask for the IMAP folder name in the account:mailbox format. (You might
think VM should already know that, but this command is a general clean-up
operation which doesn't know much about what you are doing.)

When it is done, it would have gotten rid of the information VM has kept in
your folder about what messages it thinks it has already received from.
Next time you do vm-get-new-mail, you should get new copies of those
messages. If you have fresh copies of all the "stale" messages, then you
are safe to expunge the stale messages.

Cheers,
Uday
Robert Marshall
2011-12-28 19:28:43 UTC
Permalink
Post by Uday S Reddy
Post by Uday Reddy
Once they are labelled "stale", they won't get expunged. If you want
to expunge them, you will need to delete them manually and expunge
them. But, as I said, if the stale copies are all that you have,
then your folder is an "inconsistent" state. The best way to fix it
is to get rid of the imap-cache folder and let VM regnerate a new
cache folder.
It occurred to me that there is another, slightly less painful way, of
getting your cache folder back into shape.
Maybe I wasn't clear - I had already done the expunge of the stale
messages and the emails which it thought were suspect are still there
(maybe under a different uid ) so I believe that the recovery was
complete and that everything is now consistent. I am though saving the
suggestions below :-)

Robert
--
La grenouille songe..dans son château d'eau
Links and things http://rmstar.blogspot.com/
Continue reading on narkive:
Loading...