Regenerate maildirsize for account(s) on cPanel server

Here you can find tutorials and notes for server-side maintenance/configuration

Regenerate maildirsize for account(s) on cPanel server

Postby lik » Wed Sep 01, 2010 3:03 pm

This utility regenerates maildirsize files used by the maildir+ capable clients to assist in mailbox size calculations.
# /scripts/generate_maildirsize
Must specify "--confirm" to begin. Please read and understand the usage.

Usage: generate_maildirsize <modifier> <user>

This utility regenerates maildirsize files used by the maildir+
capable clients to assist in mailbox size calculations.

Modifier Flags:
--confirm - This flag indicates that we really want to use this
utility

--allaccounts - This utility was originally intended to
assist cPanel BoxTrapper with updating maildirsize
files. Without this optional flag, generate_maildirsize
will only operate on BoxTrapper enabled accounts.

--rename - This optional flag indicates that the utility
should rename individual message files to include the
message size in the filename. This addition to the
file name format is supported by Exim and greatly
improves Exim's ability to update the maildirsize
file. POP3 accounts that store mail on the server may
be forced to download their messages again if this
option is used.

--verbose - This optional flag turns on verbose mode for
enhanced activity reporting to STDOUT.

--onlyrecalculate - This optional flag turns will cause generate_maildirsize to
only regenerate maildirsize files that are missing or are larger then 5120
bytes.

--help - display this message and exit.


First we need to remove current maildirsize files from the account:
Code: Select all
find ~{accountname}/mail -type f -name "maildirsize" \-exec echo rm -vf {} \;

Having done this, we are ready to regenerate maildirsize:
Code: Select all
/scripts/generate_maildirsize --verbose --onlyrecalculate --confirm {accountname}

Note, that sometimes cPanel cache files should be removed to view updated mailbox quotas via cPanel user interface.
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Server Side Actions

 


  • Related topics
    Replies
    Views
    Last post
cron