Some snippets for notifications (incomplete), but it should give you the general idea. Combined with an 'educational warning message' to users, and pruning repeat offender mailboxes, this works effectively.
Ken A.

use File::Find;
# $sentnoticefile nuked weekly via cron
# echo "">/usr/local/bin/sent_notice.dat
# so we don't send more than 1 notice per week to a user
open(SENT,"</$sentnoticefile");
@sent=<SENT>;
close (SENT);
$trigger_size = '50000000';
@exceptions = qw(root me etc); # leave these alone
chdir("/var/spool/mail");
find(\&biggie, ".");
sub biggie {
        my $username = $_;
        foreach $exuser(@exceptions) {
                return if($exuser eq $username);
        }
        foreach (@sent) { chomp(); return if($_ eq $username); }
        return unless -f && -s $username > $trigger_size;
        # send the notice here via sendmail or whatever....
                (I cut this part out for simplicity)
        # then add the user to the sentnoticefile.
        open(SENT,">>$sentnoticefile");
        print SENT "$username\n";
        close (SENT);
}



Edward Chase wrote:
On Mon, Sep 26, 2005 at 03:04:09PM -0400, Edward Chase wrote:
I'm having issues with my users blowing their storage
quotas while checking
their mail.

Consider this...

User is at storage limit.
User checks mail.
/var/mail/user gets copied to /var/spool/poptemp/.user.pop
New mail comes into /var/mail/user
System cannot combine the 2 files back because it exceeds
storage limit for
user.

Obviously user is leaving mail behind on server...

I haven't figured out a way around this.

Anyone run into this and figure out a way around it?


-----Original Message-----
From: Clifton Royston [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 4:03 PM
To: Edward Chase
Cc: Subscribers of Qpopper
Subject: Re: qpopper and quotas

  Yes, common known issue which admins have been batting around for
years, with no entirely satisfactory solution.

  Do you currently have /var/spool/poptemp on the same file system as
/var/mail? That exacerbates it.

Generally AFAIK the best you can do is:
  * Run qpopper in server mode which optimizes away some spool copy
    operations;

  * Put /var/spool/poptemp on a separate FS;

  * Keep hard quota set to at least 2x soft quota (so that they can
    briefly spike to 2x the normal quota;

  * Set up a separate script which runs nightly and informs the users
    they are near to going over their (soft) quota, and to clean up
    their act!
-- Clifton


Perhaps I can change qpopper to run in server mode.

I did try a soft quota of 2x the hard, but that doesn't work either.  Mail
will just keep coming in until it reaches the upper limit of the soft quota.
At some point they are going to need more space just to do any cleanup.

Maybe if I try the soft quota along with some good scripting...  Care to
share?

Thanks!




Reply via email to