รถเช่า ประเภทต่างๆ
รถเช่า จังหวัด
Block Spam Mail แบบง่ายๆ ด้วย Iptables
วันที่: 22/05/2017
เวลา: 00:55:18
iptables -N SPAMHAUS
iptables -A INPUT -p tcp --dport 25 -j SPAMHAUS
จากนั้น save
iptables-save (debian) หรือ /sbin/service iptables save (redhat)
แล้วสร้างแฟ้ม spamhaus.sh ใส่เนื้อหาตามนี้ครับ
#!/bin/sh
/sbin/iptables -F SPAMHAUS
/sbin/iptables -A SPAMHAUS -j RETURN
curl -s http://www.spamhaus.org/drop/drop.lasso |grep ^[1-9]|cut -f 1 -d ' ' | xargs -iX -n 1 /sbin/iptables -I SPAMHAUS -s X -j DROP
** ข้อความสีฟ้าต้องพิมพ์ใบบรรทัดเดียวกัน
script สำหรับ wget ในกรณีที่ใช้ curl ไม่ได้
#!/bin/sh
/sbin/iptables -F SPAMHAUS
/sbin/iptables -A SPAMHAUS -j RETURN
wget -O /tmp/spamhaus http://www.spamhaus.org/drop/drop.lasso
cat /tmp/spamhaus |grep ^[1-9]|cut -f 1 -d ' ' | xargs -iX -n 1 /sbin/iptables -I SPAMHAUS -s X -j DROP
rm -f /tmp/spamhaus
จากนั้นอย่าลืม เอา shell ดังกล่าวไปไว้ใน crontab เพื่อที่จะได้รายชื่อ spam ใหม่ทุกวัน
Credit : คุณ icez
iptables -A INPUT -p tcp --dport 25 -j SPAMHAUS
จากนั้น save
iptables-save (debian) หรือ /sbin/service iptables save (redhat)
แล้วสร้างแฟ้ม spamhaus.sh ใส่เนื้อหาตามนี้ครับ
#!/bin/sh
/sbin/iptables -F SPAMHAUS
/sbin/iptables -A SPAMHAUS -j RETURN
curl -s http://www.spamhaus.org/drop/drop.lasso |grep ^[1-9]|cut -f 1 -d ' ' | xargs -iX -n 1 /sbin/iptables -I SPAMHAUS -s X -j DROP
** ข้อความสีฟ้าต้องพิมพ์ใบบรรทัดเดียวกัน
script สำหรับ wget ในกรณีที่ใช้ curl ไม่ได้
#!/bin/sh
/sbin/iptables -F SPAMHAUS
/sbin/iptables -A SPAMHAUS -j RETURN
wget -O /tmp/spamhaus http://www.spamhaus.org/drop/drop.lasso
cat /tmp/spamhaus |grep ^[1-9]|cut -f 1 -d ' ' | xargs -iX -n 1 /sbin/iptables -I SPAMHAUS -s X -j DROP
rm -f /tmp/spamhaus
จากนั้นอย่าลืม เอา shell ดังกล่าวไปไว้ใน crontab เพื่อที่จะได้รายชื่อ spam ใหม่ทุกวัน
Credit : คุณ icez
ความคิดเห็นทั้งหมด
ยังไม่มีความคิดเห็น มาร่วมแสดงความคิดเห็นเป็นคนแรกสิ!