[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: software spam and filter content.



Claudemir Franco wrote:

I have a server the email Exchange. I would like to implement a filter of content and anti-Spam in my firewall. Exists some solution for openbsd in this level?

I just finished typing this note when I read your message.
I tested it on 3.5, but it should work on 3.4.
It inserts a few blocklists into pf every day and forwards those IPs to spamd.


Hans


# nano /etc/rc.conf.local spamd_flags="" pf=YES


# nano /etc/pf.conf
table <spammers> persist
rdr pass on $ext_if proto tcp from <spammers> to port 25 -> 127.0.0.1 port 8025



# nano /root/spam/spam-update --- #!/bin/sh

DIR=/home/hanz/spam

echo "- Updating CBL"
rsync rsync://rsync.cbl.abuseat.org/cbl/list.txt $DIR/list.txt

echo "- Updating KoreaCIDR"
wget http://www.okean.com/koreacidr.txt -O $DIR/koreacidr.txt

echo "- Updating ChinaCIDR"
wget http://www.okean.com/chinacidr.txt -O $DIR/chinacidr.txt

echo "- Creating spamlist"
echo "### CBL ###" > $DIR/spammers.txt
grep -v '#' $DIR/list.txt | grep -v '^:' >> $DIR/spammers.txt
echo "### KoreaCIDR ###" >> $DIR/spammers.txt
grep -v '#' $DIR/koreacidr.txt | cut -d ' ' -f1 >> $DIR/spammers.txt
echo "### ChinaCIDR ###" >> $DIR/spammers.txt
grep -v '#' $DIR/chinacidr.txt | cut -d ' ' -f1 >> $DIR/spammers.txt

echo "10.0.1.3" >> $DIR/spammers.txt

echo "- Applying pf rules"
pfctl -t spammers -Tr -f $DIR/spammers.txt
---

# crontab -e
20 5 * * * /root/spam/spam-update



Visit your host, monkey.org