Re: qmail-qfilter script

Payal Rathod <[email protected]>
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
On Fri, Jul 01, 2005 at 11:17:09AM +0800, Adrian Ho wrote:
> Assuming you already have qmail-qfilter installed and ready to go, and
> have pretty solid scripting experience (your posting record suggests a
> weakness in this area) and a good understanding of how qmail-qfilter 

Well, I am reading a lot of shell scripts. The problem might be I do not 
get enough practice on real scripts.
I have done a script to restrict particular domains to send me big 
mails. But it is not working. Can someone check please?

#!/bin/sh

MSIZE=10000
# I want no more than 10kb messages from restricted domains.

exec 3</dev/stdin

egrep -i -f /etc/domains <&3
err=$?

MSGSIZE=`cat - | wc -c`

if [ $MSIZE -lt $MSGSIZE ] && [ $err -eq 0 ]
then
        echo "Sorry, I want no more than 10kb messages from you."
        exit 100
fi

This is not working. I have already saved the fd to fd 3 so I can use it, still
it is not working. Can anyone suggest on some way for this?

Thanks,
Payal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.