cyrus reconstruct on single mailbox

Can someone please provide the proper syntax for reconstructing a single mailbox (for a single user) on a 10.4.6 box? As root user, I have tried:

su cyrusimap
reconstruct -r user_mailbox

But Terminal does not recognize that. I get "su: reconstruct: command not found". Also tried the following while in the /var/spool/imap/user/ dir:

./bin/reconstruct -r /var/spool/imap/user/user_mailbox

And terminal does not give an error but immediately jumps back to the command prompt leading me to believe it did nothing.

(Trying all this to solve problem on user account where they have not received any mail via Mail.app since yesterday at 2:30. Using SM I confirmed that messages are coming in and also that the message immediately after the last message the user received in Mail appears to be corrupt/spam. SM will error out when I tried to delete so I am thinking only option is to rebuild mailbox for this user.)

Ben

Mac OS X (10.4.6)

Posted on Aug 23, 2006 1:36 PM

Reply
6 replies

Aug 23, 2006 1:51 PM in response to southcityguy

sudo -u cyrusimap /usr/bin/cyrus/bin/reconstruct -r -f user/username
You can also use the ServerAdmin GUI to reconstruct a single user.

You may want to look at other methods to view the mailbox and selectively delete. You could use a POP account which is set to delete 'after' deleting a message (so you only delete the trouble message) and other mail stays intact.

Try the single user reconstruct first.

Jeff

Aug 23, 2006 2:10 PM in response to UptimeJeff

Thanks Jeff,

Before I try, one point of clarification on that syntax. On the end of that command line, you have "user/username"? I only know of one name, which is the name of the actual mailbox directory, say "user joesmith". Although are you referring to the login username too? Say "joe_smith"? In which case, I would end the line with "joe smith/user_joesmith".

Thanks for the clarification,

Ben

Aug 23, 2006 2:24 PM in response to UptimeJeff

Actually, I was able to do the reconstruct in SA but to no avail. This issue is really weird. When I even try to access the SM page where the suspect message is, SM presents an error. It won't even load the page at all but SM seems to be working fine for other messages on the other Inbox pages. If I can somehow figure out what the message ID is or something, can't I just delete if from the Terminal? I will try setting up another POP account as well, as you suggested.

Aug 23, 2006 3:05 PM in response to southcityguy

UPDATE:

I can actually access the message in SM and SM shows the message as greyed out which I assume means that it will delete it. But it never does. I have tried to purge, etc. but nothing. When I open the greyed out message, and try to delete from within the message, I get this error in SM:

ERROR:
ERROR: Could not complete request.
Query: EXPUNGE
Reason Given: System I/O error

And I get this error in the logs:

imap[5522]: IOERROR: user.joe_smith zero index record 251/299

Any ideas what is going on here?

Thanks
Ben

Aug 23, 2006 6:37 PM in response to southcityguy

You can locate the message in the user's imap folder, delete it, then reconstruct the user's mailbox.

The imap folders are at: /var/spool/imap/user
Each message is a file.
Because you can see the message in SM, you should have something to base a search. There are of course several ways to do this, here's an example:

sudo cd /var/spool/imap/user/jj
sudo grep mysearchterm *

When you find the file you can delete it
sudo rm ####

Then do a reconstruct

Jeff

Aug 24, 2006 6:55 AM in response to UptimeJeff

This issue is still dogging me! I managed to grep, locate and delete the message I thought was suspect, along with 3 other messages that appeared in the error below. I confirmed that those message IDs are no longer in the user's mailbox but I am still getting the error below in SM and still no new mail in the Mail.app. Soooo, it looks as though SM is still trying to pull these messages into it's query. I have rebuilt the mailbox again using SA but is there some index file that needs to be rebuilt or deleted? SM does not appear to know that these messages are gone...

ERROR: Connection dropped by IMAP server.
Query: FETCH 04294:4303,4305:4308 (INTERNALDATE FLAGS BODY.PEEK[HEADER.FIELDS (From Content-Type X-Priority Subject Importance Priority)])

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

cyrus reconstruct on single mailbox

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.