UW IMAP mailbox compacting
January 12, 2007 1:38 AM   Subscribe

UW IMAP stores inboxes in /var/spool/mail/[username]. When I delete mail from my inbox (using Apple Mail), a copy of the message is left behind in that file, and it gets huge, even though it appears to have actually been removed from my inbox. Is there any way to prevent this happening, or at least to compact it?
posted by cillit bang to Computers & Internet (10 answers total) 1 user marked this as a favorite
 
Best answer: When you delete a message with IMAP, they are merely flagged as Deleted. The IMAP protocol requires an "EXPUNGE" command to actually clear out these flagged messages. I believe you can tell Mail to automatically compact folders on exit under advanced account options, which will do this for you (sorry this isn't more precise: I'm currently on a PC with no access to my Mac).

As a side note, you may also want to turn on "Show Deleted Messages" from the View menu, so you can confirm to yourself that you don't have any junk left lying around.
posted by jon4009 at 2:02 AM on January 12, 2007


This is a really duuuh possibility, and I apologise, but just in case -- are you definitely doing a real delete on those emails, or is Mail just moving them to the 'Trash' folder on the server?

Under Mailbox Behaviors, I have mine set up to store the Trash folder on the server, and to only 'Permanently erase deleted messages' when they are one week old. So they stick around on the server for a while.

Alternatively, do you actually quit Mail very often? I've noticed that it often doesn't do things 'for real' on the server until I've let it do a clean quit.
posted by chrismear at 2:47 AM on January 12, 2007


Response by poster: I telnetted into imapd and ran EXPUNGE, and it worked, but the problem now is I can't find the option in Mail.app. "Compact mailboxes automatically" is ticked but greyed out.

I don't think Mail has ever expunged any messages for me, whether they're deleted, moved or what, and I definitely have quit it in that time.
posted by cillit bang at 3:00 AM on January 12, 2007


Sorry, just to be clear, do you have Mail set to move deleted mails to a Trash folder first or just mark them as deleted in place?

If you have a Trash folder, I think that Mailbox -> Erase Deleted Messages will do an expunge.
posted by chrismear at 3:08 AM on January 12, 2007


And according to this ancient article, if you're not using a Trash folder, then that command just changes to "Compact Mailbox", which will similarly expunge the currently selected mailbox. Haven't tried that one myself, though.
posted by chrismear at 3:11 AM on January 12, 2007


Response by poster: I have "Move deleted messages to Trash mailbox" enabled, and "Store deleted messages on server".

"Erase Deleted Messages" doesn't do anything other than empty the Trash, and I don't even have a "Show Deleted Messages". Get Info shows I have more messages in my inbox than are visible, so it does know they exist.
posted by cillit bang at 3:31 AM on January 12, 2007


"Store deleted messages on server [is enabled]"

And your question is "Why are my deleted messages stored on the server?"
posted by bonaldi at 6:05 AM on January 12, 2007


Response by poster: I'm fairly sure that option controls whether the Trash mailbox is stored on the server or is a local folder. My problems is with things that have been permanently deleted (or removed from my inbox) still taking up space in my inbox file.
posted by cillit bang at 6:35 AM on January 12, 2007


Best answer: How about (temporarily) switching off "Move deleted messages to Trash mailbox" and running the newly available "Compact Mailbox" command on your Inbox. Does that work?

Trying to narrow down whether the problem is: (a) Mail not bothering to run the expunge command as expected; (b) Mail is trying to run the expunge command, but it's not communicating with your server properly; or (c) your server isn't expunging things properly.

I think we've ruled out (c) given that your manual telnet session apparently worked. If clicking 'Erase Deleted Messages' does genuinely empty the Trash, then it looks like Mail is capable of expunging (because that's what it's doing when you 'empty the Trash' stored on an IMAP server), so it seems that (b) is unlikely. But I'd still be interested to see if it can succesfully run against your Inbox folder.
posted by chrismear at 6:52 AM on January 12, 2007


Response by poster: How about (temporarily) switching off "Move deleted messages to Trash mailbox" and running the newly available "Compact Mailbox" command on your Inbox. Does that work?

That actually works, though the command doesn't seem to change name (It's still "Erase Deleted Messages"). This looks like a workable solution.
posted by cillit bang at 12:40 AM on January 13, 2007


« Older If not Vicodin, then ... what?   |   How to configure second router as acces point? Newer »
This thread is closed to new comments.