ok the last thing is that we have to put out deliverquota in an exception
bracket (was in my script allready)
then we check for errorlevel 77 and user the boucesaying executeable to
bounce the message if the user is overquota

here is my whole scipt, again - every contributions are welcome

--- cut ---

SHELL="/bin/sh"

VHOME="$PWD/Maildir"
USERNAME=`echo ${PWD##*/}`
USERHOST=`PWDTMP=${PWD%/*}; echo ${PWDTMP##*/}`

logfile "mailfilter.log"

   if ( $SIZE < 262144 )
   {
      exception {
         xfilter "/usr/bin/spamc -f -u [EMAIL PROTECTED]"
      }
   }

### check if we have a maildirsize-file allready - if not : make one
   `test -e $VHOME/maildirsize`
   if( $RETURNCODE == 1)
   {
        `/var/vpopmail/bin/vuserinfo -q [EMAIL PROTECTED] >
$VHOME/maildirsize`
   }

   if (/^X-Spam-Flag: *YES/)
   {
      exception {
         include $VHOME/.mailfilter
      }

      `test -d $VHOME/.Spam`
      if( $RETURNCODE == 1)
      {
         `maildirmake -f Spam $VHOME`
      }

      exception {
         xfilter "/usr/bin/deliverquota $VHOME/.Spam"
      }
   }

   exception {
      include $VHOME/.mailfilter
   }

   # default delivery
   exception {
      xfilter "/usr/bin/deliverquota $VHOME"
   }

### check if our message was deliverd - returncode 77 means that out maildir
was overquota - bouce mail
   if( $RETURNCODE == 77)
   {
      to "|/usr/bin/bouncesaying 'user is over quota'"
   }


Reply via email to