Marco Ziesing

Development & System Administration
  • rss
  • Home
  • Über mich
  • Linkliste
  • Infos
  • Impressum

Blacklists für Spamassassin per Cronjob aktualisieren

Mai 10, 2007

Für alle deren Rechner bzw. Server über ausreichend Speicher verfügt, habe ich hier ein nettes Shell-Script geschrieben, welches die Blacklists für Spamassassin von Stearns.org lädt.

#!/bin/sh

cd /etc/mail/spamassassin

# Connection check
URL_check=”http://www.sa-blacklist.stearns.org/sa-blacklist/”
wget -t 1 -O check.html “$URL_check” -o check.log

# Run only if no ‘ERROR’ or ‘Giving up’ found in check.log
err=`grep -i ‘Giving up’ check.log | wc -l`
err2=`grep -i ERROR check.log | wc -l`

if [ $err == 0 ] && [ $err2 == 0 ]; then

# Sender Domains
URL1=”http://www.sa-blacklist.stearns.org/sa-blacklist/sa-blacklist.current.cf”
wget -O sa-blacklist.current.cf “$URL1″

# URLs in the messages
URL2=”http://www.sa-blacklist.stearns.org/sa-blacklist/sa-blacklist.current.uri.cf”
wget -O sa-blacklist.current.uri.cf “$URL2″

# Forgotten Tags
URL3=”http://www.sa-blacklist.stearns.org/sa-blacklist/random.current.cf”
wget -O random.current.cf “$URL3″

# Restart Spamassassin
/etc/init.d/spamassassin restart

fi

Das ganze in eine Textdatei, z.B. get-blacklists.sh, speichern und mit chmod +x get-blacklists.sh Rechte zum Ausführen vergeben. Dann noch mit crontab -e folgende Zeile einfügen

5 1 * * * /pfad/zum/script.sh

um das Skript jede Nacht um 1:05 Uhr ausführen zu lassen und das Ganze mit :wq sichern.

  •  
  •  
  •  
  •  
  •  
  •  
  •  
Kategorien
Linux, Server
Tags
linux, server, spam
RSS Kommentare
RSS Kommentare
Trackback
Trackback

« Hot-Babe- und HTTrack-RPMs NDISwrapper für Fedora auf i386-Maschinen »

Leave a Reply

Hier klicken, um die Antwort abzubrechen.

Kategorien

  • Hardware
  • Linux
  • Mac OS X
  • Real Life
  • Server
  • Sicherheit
  • TYPO3
  • Uncategorized
  • Webdev
  • Windows

Schlagwörter

android development fedora linux opensource piwik security serendipity server spam sql typo3 wordpress
rss RSS Kommentare valid xhtml 1.1 design by jide powered by Wordpress get firefox