View Single Post
  #5  
Old 29th May 2006, 16:51
Jose Gosalbez Jose Gosalbez is offline
Junior Member
 
Join Date: May 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logs

ls -la /home/www/web2/user/joseangel_coaat/

------------------------------------------------------------------
total 156
drwxrwxr-x 5 joseangel_coaat web2 4096 may 29 16:47 .
drwxrwxr-x 604 apache web2 24576 may 29 11:52 ..
-rw-r--r-- 1 root root 103 may 29 14:17 .antivirus.rc
-rw-r--r-- 1 root root 762 may 29 14:17 .autoresponder.rc
-rw-r--r-- 1 root root 22 may 29 14:17 .bounce-exceed-quota.txt
-rw------- 1 joseangel_coaat web2 24 may 29 14:17 .forward
-rw-r--r-- 1 root root 67866 may 29 14:17 .html-trap.rc
-rw-r--r-- 1 root root 3889 may 29 14:17 .local-rules.rc
drwxrwxr-x 3 joseangel_coaat web2 4096 may 29 12:15 mail
-rw-r--r-- 1 root root 180 may 29 14:17 .mailsize.rc
-rw-r--r-- 1 root root 507 may 29 14:17 .procmailrc
-rw------- 1 root root 809 may 29 15:45 #.procmailrc#
-rw-r--r-- 1 root root 2670 may 29 14:17 .quota.rc
drwxrwxr-x 2 joseangel_coaat web2 4096 may 29 14:17 .spamassassin
-rw-r--r-- 1 root root 1152 may 29 14:17 .spamassassin.rc
-rw-r--r-- 1 root root 1642 may 29 14:17 .user_prefs
-rw-r--r-- 1 root root 0 may 29 14:17 .vacation.msg
drwxrwxr-x 2 joseangel_coaat web2 4096 may 22 12:46 web

---------------------------------------------------------------


The quota file

---------------------------------------------------------------
# quota.rc by Stuart Clark/Falko Timme
#
# If mailbox size exceeds QUOTA, send reply email
# using $PMDIR/bounce-exceed-quota.txt
#
#LOGFILE="/tmp/procmail.quota.log"
#VERBOSE=NO

PATH="/usr/bin:$PATH:/usr/local/bin"
SHELL=/bin/sh
EMAIL=`formail -zxTo:`

:0 # if QUOTA is not set to something, then..
* ! QUOTA ?? .
{
QUOTA=10000000000
}

:0 # if QUOTA is set to something, then..
* QUOTA ?? .
{
QUOTA=`let HD_QUOTA=\`quota ${LOGNAME} | sed -n 3p | awk '{print $3}'\`*1024
if [ $HD_QUOTA != 0 ]; then
let HD_QUOTA_USED=\`quota ${LOGNAME} | sed -n 3p | awk '{print $2}'\`*1024
let HD_QUOTA_FREE=${HD_QUOTA}-${HD_QUOTA_USED}
if [ "$HD_QUOTA_FREE" -eq "$QUOTA" ]; then
QUOTA=${QUOTA}
else
if [ "$HD_QUOTA_FREE" -gt "$QUOTA" ]; then
QUOTA=${QUOTA}
else
QUOTA=${HD_QUOTA_FREE}
fi
fi
else
QUOTA=${QUOTA}
fi
echo ${QUOTA}`
#MAILBOX_SIZE_REPORT_=`wc -c ${DEFAULT}`
MAILBOX_SIZE_REPORT_=`cat \`find ${DEFAULT} -type f -follow\`| wc -c`

:0 # if
* MAILBOX_SIZE_REPORT_ ?? ^^ *\/[0-9]+
{ MAILBOX_SIZE_=${MATCH} }

:0
*$ ${QUOTA}^0
*$ -${MAILBOX_SIZE_}^0
{ }
MAILBOX_SIZE_ = $=

:0
* > ${MAILBOX_SIZE_}
{
# keep a backup for a while
:0c
/tmp/quota.${LOGNAME}

:0 # lose items we don't want to bounce
* 9876543210^0 ^FROM_DAEMON
* 1^0 ^X-Loop: X-BOUNCE-FILE-SIZE
/dev/null

:0fi # double the head, lose the body
* ^Subject: \/.*
| sed -eH -e /./b -eg -eq

SUBJECT="${MATCH}"

:0f # invert and let second copy of head (the new body) be cited:
| formail -rtk \
-I"Subject: Returned Mail: ${SUBJECT}" \
-I"From: ${EMAIL}" \
-A"X-Bounced-Reason: Mailbox quota exceeded ${QUOTA} bytes" \
-A"X-Loop: X-BOUNCE-FILE-SIZE"

# insert explanation between head and new body;
:0wf # explanation file should end with an empty line
| sed -e '1,/^$/!b' -e/./b -e 'r /home/www/web2/user/joseangel_coaat/.bounce-exceed-quota.txt'

:0 # send this bounced message from ${EMAIL} using sendmail
! -f${EMAIL} -t
}
}

-----------------------------------------------------------------------
Reply With Quote