#!/usr/bin/php = (($MAILBOX_FULL_PERCENTAGE/100)*$Quota)) { if ($VERBOSE) print "\t$Dir is overquota\n"; $OverQuota[] = $Dir; } } else { print "\tERROR: Could not find quota from first line ('$Lines[0]') in $File\n"; } } else { if ($VERBOSE) print "\tCould not open $File; assuming no quota\n"; } } $File = "/tmp/".uniqid('quota-'); $fp = fopen($File,'w+'); if (is_resource($fp)) { fputs($fp, "# List of maildir users who are over-quota\n# Auto-generated by maildir-check-quotas v$VERSION\n# Generated at ".date('r')."\n"); foreach ($OverQuota as $User) { fputs($fp, $User."\n"); } fclose($fp); exec("mv $File $OUTPUT_FILE"); } else { print "ERROR: Could not open temp file $File"; exit(5); } unlink($PID_FILE); function bytesToMeg($Bytes) { return round($Bytes/1048576,2); } function getIntro() { global $VERSION; return "maildir-check-quotas v$VERSION, copyright (c)2004 Tim Jackson\n". "This program comes with ABSOLUTELY NO WARRANTY. This is free software,\n". "and you can redistribute it under the terms of the GNU GPL v2+\n\n"; } ?>