wiki:mf-split-mailbox

Version 7 (modified by Ross, 6 years ago) (diff)

--

mf-split-mailbox

This command moves emails out of user inbox and into an archived mailbox, leaving 1000 emails in the inbox by default. It must be run as the designated user not as root.

To change user use:

servername:~# su - username

To view Maildir use:

username@servername:~$ ls -a Maildir/

To see the directories that exist and space being used

username@server:~$ du -h Maildir/ | sort -h

To see how many emails are in the inbox use:

username@server:~$ ls -l Maildir/cur/ | wc -l

Then run command:

mf-split-mailbox

Optionally you can run the command such that it leaves a different number of emails in the in box with this syntax:

# MF_MAX_MESSAGES=2000 mf-split-mailbox

To confirm split has worked, re-run:

username@server:~$ ls -l Maildir/cur/ | wc -l

Now run:

ls -a Maildir/

Look for new directory for the moved directory with date, something like:

.inbox-archive.2013-03-07

Then respond to member ticket with the name of the directory that all the mail has been moved to.

Where 2000 above is the number of emails to leave in the inbox.