Courier Imap and Quotas?

Robert Meyer meyer_rm at yahoo.com
Tue Sep 23 00:14:44 EDT 2003


Oops, dropped a piece of the code out...  Revised piece below...

--- Robert Meyer <meyer_rm at yahoo.com> wrote:
> Why not just whip up a script to check the sizes of the users' directories
> and
> send them hate mail when it gets above a certain size?  Judicious use of 'du
> -sk' can give you all sorts of information and you can write something that
> checks to see if the output of the 'du' commands yields something over your
> limit and send an Email to the user (and a summary to the admin) each night. 
> If it's just single mbox type files, you can use the output of 'du', 'ls -s',
> 'find', just to name a few.  Actually, 'find' might do it like this:
> ----- start of /usr/sbin/mailquotacheck -----
> #/bin/sh
> #
> # script to find all of the Email files bigger than 5 meg and mail the user
> # and the admin
> #
> 
> # start a file with people over quota to send to admin
> touch /var/tmp/quota$$
> 
> # go to the place to start the festivities
> cd /var/spool/mail
> 
> # locate every file here over 5 meg in size
> find . -size +5120k -exec '/usr/sbin/quotamail' /var/tmp/quota$$ '{}' ';'
> 
> /bin/mail -s "mail quota statistics" root < /var/tmp/quota$$
> /bin/rm -f /var/tmp/quota$$
> ----- end of /usr/sbin/mailquotacheck -----
> 
----- start of /usr/sbin/quotamail -----
#!/bin/sh
echo "You are currently over quota on your Email account" >
/var/tmp/quotamail$$
echo "We have a limit of 5120 kilobytes per account" >> /var/tmp/quotamail$$
echo -n "You are currently using: " >> /var/tmp/quotamail$$
mailsize=`/bin/ls -s /var/spool/mail/$2 | awk '{print $1};'`
echo $mailsize kilobytes of disk space >> /var/tmp/quotamail$$
echo >>/var/tmp/quotamail$$
echo Please clean up your Email space >>/var/tmp/quotamail$$
echo >>/var/tmp/quotamail$$
echo Thank you >>/var/tmp/quotamail$$
echo  >> /var/tmp/quotamail$$
echo The Administrative Core >> /var/tmp/quotamail$$
/bin/mail -s "Your Email account is overquota" << /var/tmp/quotamail$$
/bin/rm /var/tmp/quotamail$$
echo $2 $mailsize >> $1

-----end of /usr/sbin/quotamail -----
> 
> --- Justin Bennett <justin.bennett at dynabrade.com> wrote:
> > I'm pretty familiar with FS quotas we don't currently use them, this was 
> > a popup an imap generated message. I was hoping to set some soft limits, 
> > maybe have a warning when the user has an extraordinary amount of 
> > mail... This would just be for email, not on the users home directory as 
> > a whole. Just something I saw, was just curious.
> > 
> > Justin
> > 
> > 
> > Robert Meyer wrote:
> > 
> > >There are a series of things involved here.  First, the use of the quota
> > system
> > >to limit the amount of space a user is allowed to take up on a filesystem,
> A
> > >series of scripts that cruise the quota list and sends Email and an email
> > >system.
> > >
> > >I'm not a real big fan of quotas 'cuz I've had situations where the user
> ran
> > >out of quota space just as the big RPF for a proposal came in and it
> > bounced. 
> > >Mad scramble to clean out space and then get the program sponsor to resend
> > the
> > >RFP.  Does not present the professional image...
> > >
> > >Cheers!
> > >
> > >Bob
> > >
> > >--- Justin Bennett <justin.bennett at dynabrade.com> wrote:
> > >  
> > >
> > >>I'm playing with Courier Imap as some of you know, I'm going to deploy 
> > >>it in the next few months, I'm running sendmail/procmail with courier. I 
> > >>noticed my wife had a message when checking her UB mail, that she was 
> > >>90% of quota. Is this setup on the courier imap side or is this a MDA 
> > >>thing? Basically could I set this up with my setup? If not no biggie.
> > >>Justin
> > >>
> > >>
> > >>    
> > >>
> > >
> > >
> > >__________________________________
> > >Do you Yahoo!?
> > >Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > >http://sitebuilder.yahoo.com
> > >  
> > >
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the nflug mailing list