Page 1 of 1

Inconsistent imap-folder after timedout operation

Posted: Wed Feb 14, 2007 8:16 am
by Jan Reusig
hello board,

after I tried to move some thousand mails from "Sent items" to somewhere else with Thunderbird, the following error keeps constantly occuring:

32.092038 -> IMAP Request: 7 select "Sent Items"
32.326316 -> IMAP Response: * 2063 EXISTS
32.390483 -> IMAP Request: 8 getacl "Sent Items"
32.401116 -> IMAP Response: * ACL "Sent Items" anyone ""
32.504519 -> IMAP Request: 9 myrights "Sent Items"
32.506139 -> IMAP Response: * MYRIGHTS "Sent Items" rscwidal3
32.602982 -> IMAP Request: 10 UID fetch 1:* (FLAGS)
32.855190 -> IMAP Response: 10 NO some of the requested messages no longer exist
35.378031 -> IMAP Request: 11 IDLE
35.379427 -> IMAP Response: + idling
37.636914 -> IMAP Request: DONE

and Thunderbird gives me an errror dialog. Unfortunately, I wasn't able to get rid of it. I can't delete and recreate the folder. Outlook however works and shows the about 100 messages, that are really in the folder.
"omscan -Axva" gives no errors.

I'd be grateful for any hint...
Your's j.

Posted: Wed Feb 14, 2007 3:56 pm
by dkelly
This sounds like a problem with the imap folder cache on the server. To resolve this:
  1. Find the user's mailbox directory using

    Code: Select all

    omshowu -n "User Name" -f
    This will give the 'g' directory.
  2. In that directory is a folder called imap-cache. Make sure that the user is signed out and there are no IMAP processes running for that user (use omstat -u imap to see this).
  3. Delete the contents of the imap-cache directory but don't delete the directory itself.



it works :)

Posted: Wed Feb 14, 2007 4:08 pm
by Jan Reusig
wow, it's done! Thank you a lot!

thunderbird error message is also fixed by this

Posted: Wed Mar 07, 2007 3:29 pm
by seamusabshere
this worked for me when i got the the message

some of the requested messages no longer exist

in thunderbird (or probably any other imap client)

Posted: Fri Nov 02, 2007 7:52 pm
by foxyguitarman
This also worked for me!

Posted: Thu Jun 05, 2008 5:36 am
by sla
I had to use this procedure three times this week to fix errors where users were unable to log into their accounts via swa. I'm still trying to find a pattern in the occurrence of the error. It could be related to users trying multiple concurrent logins.

Anyway - to make things easier for me and my coworkers, I have created this little shell-script to delete the imap cache:

(Comments and improvements welcome - use at your own risk)

Code: Select all


if [ "x$1" = 'x' ]
  echo "$0 no Username given - try $0 'Username'"

USERFOLDER=`$OMSHOWU -n "$USERNAME" -f 2> /dev/null | grep "User Folder" | cut -d ":" -f 2 | cut -f 1-3 -d "/"`

if [ "x$USERFOLDER" = "x" ]
  echo "Error: User $USERNAME not found"
  exit 1
  IMAPCACHEDIR=`echo $USERFOLDER | sed "s|~|$BASEDIR|"`/imap-cache
  echo "User $USERNAME found. Directory: $IMAPCACHEDIR"
  if [ ! -d $IMAPCACHEDIR ]
    echo "Error: Directory $IMAPCACHEDIR not found"
    exit 3

echo -n "Stopping existing imap-processes ..."
$OMSTAT -u imap | grep "$USERNAME" | cut -c 65-69 | xargs -r kill
sleep 1
echo " [OK]"

echo -n "Deleting IMAP-Cache ..."
sleep 1
echo " [OK]"


Posted: Thu Jul 31, 2008 9:59 am
by Deezt
Not trying to bump really old threads but thank you sla! Your script seems like a much nicer way to deal with these random problems.

Posted: Thu Jul 31, 2008 2:39 pm
by sla
Deezt wrote:Not trying to bump really old threads but thank you sla! Your script seems like a much nicer way to deal with these random problems.

There is a much better version in the wiki

You should use the wiki-Version as it also locks the mailbox before doing operations on it.