Re: [VM] N Stale messages are ignored

2013-08-06 Thread Uday Reddy
viewmail-i...@kosowsky.org writes:

 When I run this I get:
(inbox label stale): No messages.
 
 Despite the fact that 'saving' gives me:
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



Re: [VM] N Stale messages are ignored

2013-08-06 Thread Uday S Reddy
Uday Reddy writes:

 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



[VM] N Stale messages are ignored

2013-08-05 Thread viewmail-info
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!



Re: [VM] N Stale messages are ignored

2013-08-05 Thread Uday Reddy
viewmail-i...@kosowsky.org writes:

 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.

 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?

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



Re: [VM] N Stale messages are ignored

2013-08-05 Thread viewmail-info
Thanks Uday - comments inline
Uday Reddy wrote at about 15:34:42 +0100 on Monday, August 5, 2013:
  viewmail-i...@kosowsky.org writes:
  
   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.

When I run this I get:
 (inbox label stale): No messages.

Despite the fact that 'saving' gives me:
 492 stale deleted messages are ignored


  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

  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.

I'm not sure what situations I am or how to determine... hence, not
sure how I should respond...

  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.
  
   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?
  
  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
  
  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.

  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.

  Cheers,
  Uday

Thanks again for your help!