On 7/13/15, Markus Rosjat <ros...@ghweb.de> wrote:
> hi there,
>
> I have a script the following script to delete spam mx ip from the spamd
> whitelist and write them in my own blacklist. After that I reload the
> blacklist with spamd- setup.  This seems to work but I noticed when the
> same ip has another mail in the greylist the ip becomes whitelisted if
> the delivery attempt is successful (which it shouldnt in the first place
> because I trapped the ip and put it in my blacklist). This seems like an
> odd behaviour to me, its not the end of the world but it feels kinda
> wrong :)

If i understand your message correctly, after removal of the ip
from the WHITE list, it still remains in the GREY, which will be
WHITE-listed again, on the next spamd scan (60 second interval),
thus, allowing for the successful delivery.

To see this with an IP that has been WHITE-listed, but still in
the GREY, do:

$ spamdb | grep $ip
WHITE|$ip|...
GREY|$ip|...
$ spamdb -d $ip
$ spamdb | grep $ip
GREY|$ip|...
$ sleep 60
$ spamdb | grep $ip
WHITE|$ip|...
GREY|$ip|...


As a side note, your awk bit can be replaced by a `cut -d \| -f 2'.

--patrick


> here is the script:
>
> ip_range=$1
>
> for i in `spamdb | grep $ip_range | grep WHITE | awk -F "|" '{print $2}'`;
>   do
>    echo $i
>    /usr/sbin/spamdb -d $i
>    /usr/sbin/spamdb -a -t $i
>    echo $i >> /etc/mail/blacksheep.txt
>   done
>
> /usr/libexec/spamd-setup
>
> maybe someone give me some hints for improvement
>
> regards
>
> --
> Markus Rosjat    fon: +49 351 8107223    mail: ros...@ghweb.de
>
> G+H Webservice GbR Gorzolla, Herrmann
> Königsbrücker Str. 70, 01099 Dresden
>
> http://www.ghweb.de
> fon: +49 351 8107220   fax: +49 351 8107227
>
> Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss! Before you
> print it, think about your responsibility and commitment to the ENVIRONMENT

Reply via email to