Skip to content

A shell script that grabs the latest Spamhaus DROP & EDROP Lists and adds them to iptables.

License

Notifications You must be signed in to change notification settings

urmel1960/spamhaus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Spamhaus DROP List

A shell script that grabs the latest Spamhaus DROP & EDROP Lists and adds them to iptables. We use this script (among other tools) on our Debian web server & Ubuntu proxy server at AppThemes to cut down on spam and other malicious activity.

Usage

Place the script somewhere on your server.

# find a nice home
cd /home/YOUR-USERNAME/bin/

# create the file and paste
vim spamhaus.sh

# make it executable
chmod +x spamhaus.sh

# set it loose
sudo ./spamhaus.sh

# confirm the rules have been added
sudo iptables -L Spamhaus -n

Automatic Updating

In order for the list to automatically update each day, you'll need to setup a cron job with crontab.

# fire up the crontab (no sudo)
crontab -e

# run the script every day at 3am
0 3 * * * /home/YOUR-USERNAME/bin/spamhaus.sh

Troubleshooting

If you need to remove all the Spamhaus rules, run the following:

sudo iptables -F Spamhaus
sudo iptables -F SpamhausAct

About

A shell script that grabs the latest Spamhaus DROP & EDROP Lists and adds them to iptables.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%