Discussion:
[VM] N Stale messages are ignored
v***@kosowsky.org
2013-08-05 12:54:45 UTC
Permalink
I keep getting the above message when I save my Imap folder.

I read in an old posting that one solution is to:
- Run: vm-prune-imap-retrieved-list
- Remove the imap-cache folder and then let VM regenerate it

Is this still the best way to do this?
Or is there something/easier/better/more automatic from within vm?
Is there any meaningful risk that this will "mess" things up if I follow the
above two steps?

Also, out of curiosity, what tends to cause such stale message formation?

Thanks!
Uday Reddy
2013-08-05 14:34:42 UTC
Permalink
Post by v***@kosowsky.org
I keep getting the above message when I save my Imap folder.
I copy my old message below:

`V l stale' shows the stale messages.

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.
Post by v***@kosowsky.org
- Run: vm-prune-imap-retrieved-list
- Remove the imap-cache folder and then let VM regenerate it
Is this still the best way to do this?
Note that I distinguished between two separate cases in my previous message.
(i) UIDVALIDITY change and (ii) result of previous IMAP faults. You haven't
said which case you are dealing with.

The first case (UIDVALIDITY change) is straightforward. You can just get
rid of all the stale messages.

The second case is more complicated. That is why VM leaves it to you to
figure out what went wrong and do the right thing. VM has no idea what
faults might have occurred to cause those stale messages. For all it knows,
the stale messages might be the only copies of those messages you have, and
if you delete them, you might lose them forever.

So, your best course is to find out what those stale messages are and
whether they are redundant copies are essential ones.

Cheers,
Uday
v***@kosowsky.org
2013-08-06 00:26:33 UTC
Permalink
Thanks Uday - comments inline
Post by Uday Reddy
Post by v***@kosowsky.org
I keep getting the above message when I save my Imap folder.
`V l stale' shows the stale messages.
When I run this I get:
(inbox label stale): No messages.

Despite the fact that 'saving' gives me:
492 stale deleted messages are ignored
Post by Uday Reddy
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.
I don't get any question asked -- perhaps because vm thinks there are
no Messages in the stale virtual folder
Post by Uday Reddy
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
- 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.
I'm not sure what situations I am or how to determine... hence, not
sure how I should respond...
Post by Uday Reddy
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.
Post by v***@kosowsky.org
- Run: vm-prune-imap-retrieved-list
- Remove the imap-cache folder and then let VM regenerate it
Is this still the best way to do this?
Note that I distinguished between two separate cases in my previous message.
(i) UIDVALIDITY change and (ii) result of previous IMAP faults. You haven't
said which case you are dealing with.
How do I know which case applies to me... the only way I even got a
clue about stale messages is from the message I received "492 stale deleted messages are ignored"
Post by Uday Reddy
The first case (UIDVALIDITY change) is straightforward. You can just get
rid of all the stale messages.
How would I do this? I don't seem to get a list of them to delete.
Post by Uday Reddy
The second case is more complicated. That is why VM leaves it to you to
figure out what went wrong and do the right thing. VM has no idea what
faults might have occurred to cause those stale messages. For all it knows,
the stale messages might be the only copies of those messages you have, and
if you delete them, you might lose them forever.
So, your best course is to find out what those stale messages are and
whether they are redundant copies are essential ones.
Again, I don't even know what the stale messages are so I can't tell
if they are redundant or not.
Post by Uday Reddy
Cheers,
Uday
Thanks again for your help!
Uday Reddy
2013-08-06 10:00:15 UTC
Permalink
Post by v***@kosowsky.org
(inbox label stale): No messages.
492 stale deleted messages are ignored
In my experience, this situation happens only when a transfer from the IMAP
server had to be aborted, either due to network problems or typing Ctrl-G.
In that case, the downloaded messages would not have been properly
initialized. So, the connection between them and the corresponding messages
on the server would not have been established. VM knows them because they
have invalid UIDs.

I just tried this situation with vm-8.2.0b. When I attempt to save the
folder, VM generates the following dialogue:

Found 11 messages with invalid UIDs. Expunge them? (y or n) n
They will be labelled 'stale'

Since I answered 'n' to the questin, all those messages got labelled as
"stale". I can view them by doing `V C label stale'.

If I answered 'y' to the question, then those messages would have been
expunged from the cache folder and I would never hear from them again.

If you haven't seen anthing like this, then you should assume that your
cache folder is corrupted and regenerate it. To delete the cache folder, do
`M-x buffer-menu' and find the entry corresponding to the damaged folder.
The entry should have the full path name of the cache folder. Do `M-x
delete-file' for that path name.

Next time you visit the IMAP folder, VM will download fresh copies of all
the messages. If downloading all the messages again would be too
time-consuming, you can use the "external messages" feature, which is
described in the VM manual.

Cheers,
Uday
Uday S Reddy
2013-08-06 10:13:14 UTC
Permalink
Post by Uday Reddy
If you haven't seen anthing like this, then you should assume that your
cache folder is corrupted and regenerate it. To delete the cache folder, do
`M-x buffer-menu' and find the entry corresponding to the damaged folder.
The entry should have the full path name of the cache folder. Do `M-x
delete-file' for that path name.
Perhaps you might want to rename the cache folder instead of deleting it.
If it has copies of essential messages that got deleted from the server, you
would at least have them in that folder.

Cheers,
Uday
Uday Reddy
2013-08-06 11:10:57 UTC
Permalink
Post by v***@kosowsky.org
Again, I don't even know what the stale messages are so I can't tell
if they are redundant or not.
Here is an idea that might help. Load the vm-avirtual library, and type the
following

V C eval <RET> (null (vm-imap-uid-of vm-virtual-message)) <RET>

This gives you a virtual folder of messages that have nil as their UID.
Uninitialized messages generally fall in this category.

Cheers,
Uday

Loading...