Home Forums OS X Server and Client Discussion Mail Emptying a Mailbox via Command Line

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #369757
    alpha39
    Participant

    Hi all, I’d like to regularly clear out my spamassassin junk imap mailbox about once a week or so to keep things tidy after sa-learn has done its thing with them. I thought I could do it just by running a command to delete all the .123 type files in the box, but they still appear in webmail, though just as empty messages.

    I figured this was because of the cyrus.* files in the mailbox, but removing those leaves the account undeliverable.

    Any ideas? Thanks! 🙂

    #369772
    alpha39
    Participant

    Well that did the trick… Somewhat.

    I fired off reconstruct with no arguments (doh), and got to watch it go through every user and clean out their mailboxes.

    While I now know how to get it to target just my junk boxes, does anyone know if I can restore the mails for my other users or are they toast?

    Don’t run reconstruct on its own unless you want to loose everything!

    #369774
    alpha39
    Participant

    Okay, I highly suggest [b]nobody ever try using reconstruct on OS X Server. [/b] From my experience here and others on this forum and apple support, it looks like it will break mailboxes no matter how you run it.

    For anyone who has nuked their databases with this, I was able to rebuild it using “mailbfr -f” which you can download here: http://osx.topicdesk.com/content/view/41/57/

    Unfortunately it will reset your read states, but that’s better then starting from scratch!

    #369947
    JasonHeiser
    Participant

    I would recommend using Cyrus’s ipurge tool.

    I use it to regularly delete messages from the spam quarantine on our 10.3.9 server.[code]sudo -u cyrus /usr/bin/cyrus/bin/ipurge -X -d 14 Quarantine/Spam[/code]Any message older than 14 days is deleted from Quarantine/Spam (a public folder on our server) by this command. No reconstruct is necessary.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed