1 message in net.sourceforge.lists.courier-maildrop[maildropl] maildroprc for managing o...
FromSent OnAttachments
Mohan NakkaOct 8, 2008 1:51 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] maildroprc for managing overquota notificationsActions...
From:Mohan Nakka (kna@gmail.com)
Date:Oct 8, 2008 1:51:12 pm
List:net.sourceforge.lists.courier-maildrop

Hello,

I have mailserver setup with postfix+mysql+courier with maildrop as the delivery agent for virtual users. I would like to send a custom bounce message to the sender notifying that the recipients mailbox is full.

master.cf file has:

maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -w 95 /etc/maildroprc -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}

Which sends a warning message to the mailbox owner when the mailbox hits 95%. This part works well. Currently, /etc/maildroprc file contains filtering for vacation/autorespond.

I would like to have filtering done for quota, so that when the mailbox hits the quotalimit, the sender receives a custom message.

So far I have tried something like the following in /etc/maildroprc just for quota: The problem is that, it is not able to catch the RETURNCODE of 77 to process the custom message, since xfilter returns either 0 or 1. How do I go about solving this?

Thanks much...

--------------------- VERBOSE="9" EXTENSION="$1" USER="$5" HOST="$6" FROM="$USER@$HOST" HOME="/home/vmail" DEFAULT="$HOME/$HOST/$USER/Maildir"

logfile "/tmp/maildrop.log"

`test -e $DEFAULT/maildirsize` if (RETURNCODE == 0) { MAILDIRQUOTA=`/usr/bin/head -n1 $DEFAULT/maildirsize` }

`test -x /usr/bin/deliverquota` if (RETURNCODE == 1) { log " WARNING: no deliverquota!" } else { if (RETURNCODE == 77) { log " Over Quota. Current size $MAILDIRQUOTA" to "| mailbot -t /tmp/fullwarning.txt /usr/sbin/sendmail -t -f ''" } else { exception { xfilter "/usr/bin/deliverquota -w 95 $DEFAULT" log "Delivered to $DEFAULT" }

if (RETURNCODE == 0) { log "success quota $MAILDIRQUOTA" to "$DEFAULT" # EXITCODE=0 # exit } else { log "different error code" } } }