View Full Version : Script to find full mailboxes.

06-10-2011, 10:49 AM
Is there a command to write all mailbox percentages to a text file? I am pretty sure there is I just cant find any documentation.

06-10-2011, 11:26 AM
Something certainly could be whipped up, I did a script to give me the total size of user mailboxes, but we don't have quotas for our user's.

Have you looked into the API at all?

..I looked into the API and you could use U_MailboxQuota and U_MailboxSize aspects of the Accounts API to access these settings. The returned values from these two variables are integers. You'll need to do some additional functions to get the overall result into a percentage. If I have some time today, I'll see what I can come up with in a PHP script

06-10-2011, 12:24 PM
The script I came up with, I think the results from U_MailboxQuota & U_MailSize are returned as an integer value in kilobytes (kB).


// Initialize APIs

// Test if APIs are loaded
if (api_status() == "Error") {
echo "Error: Unable to load APIs. Exiting.";

icewarp_apiobjectcall($acct_api, 'Open', 'bmurtagh');
$quota = icewarp_apiobjectcall($acct_api, 'GetProperty', 'U_MailboxQuota');
$size = icewarp_apiobjectcall($acct_api, 'GetProperty', 'U_MailboxSize');

echo "Quota: ".$quota." kB <br />";
echo "Size: ".$size." kB <br />";


06-18-2011, 01:37 PM

Check this: http://forum.icewarp.com/forum/content.php?175-Script-Mailbox-Size-For-All-Users

If any programmer out there could do the big favor of making the above script sort the results and show users that are over the limit in the beginning, Id appreciate it.

Maybe this can also help: http://forum.icewarp.com/forum/content.php?149-Scripts


09-06-2011, 05:58 AM
Hi All,
Regarding the above request, I have created a script that lists accounts that are above their quota.

The main difference between my script and the one currently in the administrator tools section on the forum is that in addition to listing accounts over their quota, it can also list accounts that have gone over a certain percentage of their quota e.g you can set the script variable $limit_quota to 80 and this will list all the user accounts that have used 80% and over of their quota. Comes in handy for auditing, marketing and planning purposes.

The script produces 3 log files:
- 1 html log file showing all accounts above their usage based on the percentage set in the script. Accounts that have used up 100% of their quota are listed in red
- 1 csv file for each domain listing all the accounts that are above the percentage set
- 1 csv file listing all accounts from all domains that above the percentage set. handy if you dont want to open each domain csv file.

Please read the comments section in the script, it will guide you where to change the directory to save the log files, the account quota percentage you want to set and the timezone you are running the script from for log file timestamping.

If you receive timeout errors, it is advisable to run it under fastcgi with a high timeout if you have a large number of accounts on your server. Please see Icewarp help file to set this up.

The script will make it to the administrator tools section soon. Please post any bugs,questions etc
Hope it suits your needs.



06-03-2015, 06:04 AM
Hi, I tried to run this script but i get the:
Error HTTP 404.0 - Not Found

I follow all the steps in the two tutorials but no one work for me.

Any advice?


06-30-2015, 04:32 PM
Hi, Zierzo

For me it worked fine. Tested on Icewarp 11.2.1.

I used this newer version: http://forum.icewarp.com/forum/content.php?220-Script-Mailbox-Size-For-All-Users-Edit-%28new-version-by-Bulldust%29

Put the quota_check folder (with the quota_check.php file) file inside icewarp/html. The only thing I did was create the d:\quota_check folder as it is referred to in the script and asks you to adjust that path (in my case I simply created such folder in file system).

Then I called, inside the server http://localhost/quota_check/quota_check.php

It ran fine.

Seems like you have some issue perhaps with paths, have to check where you put the PHP file and how youre calling it from the browser.

Also enabling web server logs (w3c) and checking phperror.log might help as well as basic tests like store a simple html test file in same place and access it via URL browser to see if youre able to hit the files correctly via web on such directory.

Hope it helps.


Bill Linton
04-19-2016, 08:02 AM
it works. thank you. (http://loaditsoft.com/)