Courier Imap and Quotas?
Justin Bennett
justin.bennett at dynabrade.com
Tue Sep 23 11:30:16 EDT 2003
Ok not sure if I'm going to actually use any of this was just curious,
it's for the manager types to decide.
Thanks
Justin
Robert Meyer wrote:
>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
>
>
--
Justin Bennett
Network Administrator
RHCE (Redhat Certified Linux Engineer)
Dynabrade, Inc.
8989 Sheridan Dr.
Clarence, NY 14031
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nflug.org/pipermail/nflug/attachments/20030923/0d007463/attachment-0001.html
More information about the nflug
mailing list