[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mbox files - can they be "compacted"?



On Sun, Apr 06, 2014 at 02:10:09PM +0200, Rafał Radecki wrote:
> Is there an option to compact large mbox files from the shell? I did not
> find anything in google, I have some very large constantly updated mbox
> files and would like to know if they can be made smaller with any tool.
> AFAIK mutt does such operation when for example an email is deleted but I
> am curious if there are other options.

Since you say that the mailboxes are constantly being updated, you need
to figure out what mailbox formats your MDA supports. If you just gzip them
the odds are the MDA will create a new mailbox in the old path (since the
file you gzipped will be renamed to suffix .gz in most cases).

If you don't have a hard requirement to keep one mailbox, writeable, then
use cron and archivemail to automatically move older messages out of your
live mailbox into an archive mailbox.

E.g. if you have a folder 'myfolder', "archivemail -d 30 myfolder" will
move any messages older than 30 days into a (possibly newly created)
'myfolder_archive.gz'. This can be read by mutt(1) directly, and possibly
others.


Reply to: